Skip to content

Commit

Permalink
Switch from commands.wait_for() to self.bot.wait_for()
Browse files Browse the repository at this point in the history
  • Loading branch information
notsniped committed Apr 2, 2024
1 parent 3399cb2 commit c577b1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cogs/minigames.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ def __init__(self, bot):
@commands.cooldown(1, 10, commands.BucketType.user)
async def guessthenumber(self, ctx: ApplicationContext):
number = randint(1, 10)
localembed = discord.Embed(name="Guess the number!", description="I am currently thinking of a number from 1 to 10. Can you guess what it is?", color=color)
localembed = discord.Embed(title="Guess the number!", description="I am currently thinking of a number from 1 to 10. Can you guess what it is?", color=color)
localembed.set_footer(text="If you guess what it is, you will win 500 to 1000 coins!")
await ctx.respond(embed=localembed)
def check(msg): return msg.author == ctx.author and msg.channel == ctx.channel and msg.content
msg = await commands.wait_for("message", check=check)
msg = await self.bot.wait_for("message", check=check)
if int(msg.content) == number:
randcoins = randint(500, 1000)
currency.add(ctx.author.id, randcoins)
await ctx.respond(f"Correct! You've just won **{randcoins} coins** by guessing the correct number.")
else: return await ctx.respond("Too bad bozo, you guessed the number wrong and you won nothing.")
await ctx.channel.send(f"Correct {ctx.author.mention}! You've just won **{randcoins} coins** by guessing the correct number.")
else: return await ctx.channel.send(f"{ctx.author.mention} Too bad bozo, you guessed the number wrong and you won nothing.")

@commands.slash_command(
name="highlow",
Expand Down

0 comments on commit c577b1b

Please sign in to comment.