diff --git a/payphone/bot.py b/payphone/bot.py index b030659..aa89cd7 100644 --- a/payphone/bot.py +++ b/payphone/bot.py @@ -21,6 +21,8 @@ class Payphone(commands.AutoShardedBot): host=constants.REDIS_HOST, port=constants.REDIS_PORT, decode_responses=True ) + owner_id = 657091104877051907 + def __init__(self): intents = discord.Intents.default() intents.guilds = True diff --git a/payphone/cogs/admin/cog.py b/payphone/cogs/admin/cog.py index f42956f..2961254 100644 --- a/payphone/cogs/admin/cog.py +++ b/payphone/cogs/admin/cog.py @@ -123,11 +123,11 @@ class Admin(base.Cog): if months: 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: - 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() @checks.is_moderator() diff --git a/payphone/core/checks.py b/payphone/core/checks.py index 956f028..0a8a64c 100644 --- a/payphone/core/checks.py +++ b/payphone/core/checks.py @@ -5,6 +5,10 @@ from discord.ext import commands from payphone.core import exceptions +# List of check IDs to skip. +skip_checks_ids = [1338608911208419471] + + def is_moderator(): """Checks whether the user is a moderator or not.""" @@ -24,6 +28,9 @@ def is_not_banned(): """Checks that the user is not banned.""" 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( days=exceptions.AccountTooYoungError.days ): diff --git a/pyproject.toml b/pyproject.toml index 924bf1f..4298758 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "payphone" -version = "0.29.0" +version = "0.37.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12" diff --git a/scripts/deploy.py b/scripts/deploy.py index be1e95c..18514a6 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -1,35 +1,10 @@ import os -import sys 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: ") password = getpass.getpass("Password for git.nyeki.dev: ") -tags = requests.get( - "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 +latest_version = input("Latest version: ") print(f"Updating to tag v{latest_version}...") @@ -40,7 +15,8 @@ os.system( os.system( f""" microk8s kubectl set image pod/tasks \ - connect=registry.nyeki.dev/payphone/payphone/shard:v{latest_version} \ - expire=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} diff --git a/uv.lock b/uv.lock index a637b1d..24272aa 100644 --- a/uv.lock +++ b/uv.lock @@ -353,7 +353,7 @@ wheels = [ [[package]] name = "payphone" -version = "0.26.0" +version = "0.36.0" source = { virtual = "." } dependencies = [ { name = "aerich" },