added ephemeral, check if it's the correct channel
This commit is contained in:
parent
f7d59f1b1a
commit
4153aeef8f
1 changed files with 18 additions and 11 deletions
21
src/main.py
21
src/main.py
|
@ -35,17 +35,24 @@ def main():
|
|||
async def reserve_slot(ctx: interactions.CommandContext, steamid: str):
|
||||
steam_id = SteamID(steamid)
|
||||
user = ctx.user
|
||||
if steam_id.isValid() == True:
|
||||
channel = ctx.channel.id
|
||||
|
||||
if channel != "433738529898627073":
|
||||
await ctx.send(f"This command only works in the Channel <#433738529898627073>!", ephemeral=True)
|
||||
return
|
||||
|
||||
if steam_id.isValid() == False:
|
||||
await ctx.send(f"You failed to give a valid SteamID as it seems, please head to <https://steamid.xyz/ and check.", ephemeral=True)
|
||||
return
|
||||
|
||||
try:
|
||||
database.create_reserved_slot(mysql, user, steam_id.steam2(1))
|
||||
await ctx.send(f"You just claimed a reserved slot for: `{steam_id.steam2(1)}`!")
|
||||
except Exception as err:
|
||||
if str(err) == "Duplicate entrys":
|
||||
await ctx.send(f"You have already claimed a reserved slot!")
|
||||
else:
|
||||
await ctx.send(f"Something failed with the database, please try again later.")
|
||||
else:
|
||||
await ctx.send(f"You failed to give a valid SteamID as it seems, please head to <https://steamid.xyz/ and check.")
|
||||
if str(err) != "Duplicate entrys":
|
||||
await ctx.send(f"Something failed with the database, please try again later.", ephemeral=True)
|
||||
return
|
||||
await ctx.send(f"You have already claimed a reserved slot!", ephemeral=True)
|
||||
|
||||
bot.start()
|
||||
|
||||
|
|
Loading…
Reference in a new issue