feat(shard): ✨ Ignore checks for hardcoded IDs.
This commit is contained in:
@@ -21,6 +21,8 @@ class Payphone(commands.AutoShardedBot):
|
|||||||
host=constants.REDIS_HOST, port=constants.REDIS_PORT, decode_responses=True
|
host=constants.REDIS_HOST, port=constants.REDIS_PORT, decode_responses=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
owner_id = 657091104877051907
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.guilds = True
|
intents.guilds = True
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ class Admin(base.Cog):
|
|||||||
|
|
||||||
if months:
|
if months:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
f"Gave the Supporter role to {ctx.author.mention} for {months} months."
|
f"Gave the Supporter role to <@{user.id}> for {months} months."
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await ctx.send(f"Removed the Supporter role from {ctx.author.mention}.")
|
await ctx.send(f"Removed the Supporter role from <@{user.id}>.")
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@checks.is_moderator()
|
@checks.is_moderator()
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ from discord.ext import commands
|
|||||||
from payphone.core import exceptions
|
from payphone.core import exceptions
|
||||||
|
|
||||||
|
|
||||||
|
# List of check IDs to skip.
|
||||||
|
skip_checks_ids = [1338608911208419471]
|
||||||
|
|
||||||
|
|
||||||
def is_moderator():
|
def is_moderator():
|
||||||
"""Checks whether the user is a moderator or not."""
|
"""Checks whether the user is a moderator or not."""
|
||||||
|
|
||||||
@@ -24,6 +28,9 @@ def is_not_banned():
|
|||||||
"""Checks that the user is not banned."""
|
"""Checks that the user is not banned."""
|
||||||
|
|
||||||
async def predicate(ctx: commands.Context) -> bool:
|
async def predicate(ctx: commands.Context) -> bool:
|
||||||
|
if ctx.author.id in skip_checks_ids:
|
||||||
|
return True
|
||||||
|
|
||||||
if ctx.author.created_at > datetime.now(timezone.utc) - timedelta(
|
if ctx.author.created_at > datetime.now(timezone.utc) - timedelta(
|
||||||
days=exceptions.AccountTooYoungError.days
|
days=exceptions.AccountTooYoungError.days
|
||||||
):
|
):
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "payphone"
|
name = "payphone"
|
||||||
version = "0.29.0"
|
version = "0.37.0"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
+4
-28
@@ -1,35 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
try:
|
|
||||||
import requests
|
|
||||||
|
|
||||||
except ImportError:
|
|
||||||
print(
|
|
||||||
"You need to install `requests` to use this file. Run `pip install requests` and try "
|
|
||||||
"again."
|
|
||||||
)
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
username = input("Username for git.nyeki.dev: ")
|
username = input("Username for git.nyeki.dev: ")
|
||||||
password = getpass.getpass("Password for git.nyeki.dev: ")
|
password = getpass.getpass("Password for git.nyeki.dev: ")
|
||||||
|
|
||||||
tags = requests.get(
|
latest_version = input("Latest version: ")
|
||||||
"https://registry.nyeki.dev/v2/payphone/payphone/shard/tags/list",
|
|
||||||
auth=(username, password),
|
|
||||||
).json()["tags"]
|
|
||||||
|
|
||||||
latest_version = 1
|
|
||||||
|
|
||||||
for tag in tags:
|
|
||||||
tag: str
|
|
||||||
|
|
||||||
if tag[1:].isdecimal():
|
|
||||||
version = int(tag[1:])
|
|
||||||
|
|
||||||
if version > latest_version:
|
|
||||||
latest_version = version
|
|
||||||
|
|
||||||
print(f"Updating to tag v{latest_version}...")
|
print(f"Updating to tag v{latest_version}...")
|
||||||
|
|
||||||
@@ -40,7 +15,8 @@ os.system(
|
|||||||
os.system(
|
os.system(
|
||||||
f"""
|
f"""
|
||||||
microk8s kubectl set image pod/tasks \
|
microk8s kubectl set image pod/tasks \
|
||||||
connect=registry.nyeki.dev/payphone/payphone/shard:v{latest_version} \
|
connect=registry.nyeki.dev/payphone/payphone/shard:v{latest_version}
|
||||||
expire=registry.nyeki.dev/payphone/payphone/shard:v{latest_version} \
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# expire=registry.nyeki.dev/payphone/payphone/shard:v{latest_version}
|
||||||
|
|||||||
Reference in New Issue
Block a user