fuckass interactions....
This commit is contained in:
parent
2e4576ba4b
commit
59ce219183
3 changed files with 7 additions and 7 deletions
|
@ -7,7 +7,7 @@ import asyncio
|
|||
from modules.globalvars import bot
|
||||
from modules.volta.main import _
|
||||
|
||||
@bot.hybrid_command(description=_('minigames_guess_the_number'))
|
||||
# @bot.hybrid_command(description=_('minigames_guess_the_number'))
|
||||
async def guessthenumber(ctx: commands.Context):
|
||||
number = random.randint(1, 10)
|
||||
class GuessModal(ui.Modal, title=_('minigames_guess_the_number')):
|
||||
|
@ -30,7 +30,7 @@ async def guessthenumber(ctx: commands.Context):
|
|||
view.add_item(button)
|
||||
await ctx.send(_('minigames_click_to_guess'), view=view)
|
||||
|
||||
@bot.hybrid_command(description=_('minigames_hangman'))
|
||||
# @bot.hybrid_command(description=_('minigames_hangman')) nope nope nope fuck no nope no thanks no nuh uh not today nope
|
||||
async def hangman(ctx: commands.Context):
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get("https://random-word-api.herokuapp.com/word?number=1") as resp:
|
||||
|
@ -61,11 +61,11 @@ async def hangman(ctx: commands.Context):
|
|||
elif wrong_guesses >= max_wrong:
|
||||
await interaction.response.edit_message(content=f"{_('minigames_hangman_lost')} **{word}**", view=None)
|
||||
else:
|
||||
await interaction.response.edit_message(content=_('minigames_hangman_game').format(display_word=display_word,wrong_guesses=wrong_guesses,max_wrong=max_wrong), view=view)
|
||||
await interaction.response.edit_message(content=_('minigames_hangman_game').format(display_word=display_word(),wrong_guesses=wrong_guesses,max_wrong=max_wrong), view=view)
|
||||
async def button_callback(interaction: Interaction):
|
||||
await interaction.response.send_modal(GuessModal())
|
||||
button = ui.Button(label="Guess a letter", style=discord.ButtonStyle.primary)
|
||||
button = ui.Button(label=_('minigames_click_to_guess'), style=discord.ButtonStyle.primary)
|
||||
button.callback = button_callback
|
||||
view = ui.View()
|
||||
view.add_item(button)
|
||||
await ctx.send(f"Word: {display_word()}\nWrong guesses: {wrong_guesses}/{max_wrong}\nClick the button to guess a letter.", view=view)
|
||||
await ctx.send(_('minigames_hangman_game').format(display_word=display_word,wrong_guesses=wrong_guesses,max_wrong=max_wrong), view=view)
|
Loading…
Add table
Add a link
Reference in a new issue