bump requirements, update to new interactions syntax

This commit is contained in:
Philipp 2024-10-07 22:47:24 +02:00
parent b2c9c95821
commit 3b23bd1a0b
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750
2 changed files with 18 additions and 19 deletions

View file

@ -1,5 +1,5 @@
discord-py-interactions==4.3.1
discord-py-interactions==5.13.2
steamid==1.0.2
python-dotenv==0.21.0
mysql-connector-python==8.0.30
loguru==0.6.0
python-dotenv==1.0.1
mysql-connector-python==8.0.29
loguru==0.7.2

View file

@ -1,8 +1,8 @@
import os
import sys
import signal
import interactions
from interactions import Client, Intents, listen, slash_command, slash_option, OptionType, SlashContext
from database import Database
from dotenv import load_dotenv
from steamid import SteamID
@ -38,7 +38,7 @@ def main(args):
password = os.getenv('MYSQL_PASSWORD')
db = os.getenv('MYSQL_DATABASE')
bot = interactions.Client(token=token)
bot = Client(intents=Intents.DEFAULT)
con = Database(host, user, password, db)
@ -50,21 +50,20 @@ def main(args):
logger.info(f"Skipping database init...")
pass
@bot.command(
@slash_command(
name="reserve_slot",
description="Claim your reserved slot on the DM Server",
scope=433600034983116810,
options=[
interactions.Option(
name="steamid",
description="Please provide your SteamID, from https://steamid.xyz/",
type=interactions.OptionType.STRING,
required=True,
),
],
scopes=[433600034983116810],
)
async def reserve_slot(ctx: interactions.CommandContext, steamid: str):
@slash_option(
name="steamid",
description="Please provide your SteamID, from https://steamid.xyz/",
required=True,
opt_type=OptionType.STRING,
)
async def reserve_slot(ctx: SlashContext, steamid: str):
channel = ctx.channel.id
user = ctx.user
@ -97,7 +96,7 @@ def main(args):
await ctx.send(f"You have already claimed a reserved slot!", ephemeral=True)
logger.debug(f"{steam_id.steam2(1)} or User {user.username} ({user.id}) is already in the database.")
bot.start()
bot.start(token)
while True:
logger.info("Trying graceful shutdown...")