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
|
||||
)
|
||||
|
||||
owner_id = 657091104877051907
|
||||
|
||||
def __init__(self):
|
||||
intents = discord.Intents.default()
|
||||
intents.guilds = True
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
@@ -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
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user