feat(shard): ✨ Ignore checks for hardcoded IDs.

This commit is contained in:
Nyeki.py
2025-02-14 17:13:13 -03:00
parent dae522b061
commit fbc64e0d19
6 changed files with 17 additions and 32 deletions
+2
View File
@@ -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
+2 -2
View File
@@ -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()
+7
View File
@@ -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
):
+1 -1
View File
@@ -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"
+4 -28
View File
@@ -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}
Generated
+1 -1
View File
@@ -353,7 +353,7 @@ wheels = [
[[package]]
name = "payphone"
version = "0.26.0"
version = "0.36.0"
source = { virtual = "." }
dependencies = [
{ name = "aerich" },