From 610724b7e5e654c951f75d0883ac196406a5f21f Mon Sep 17 00:00:00 2001 From: BigGamerGary Date: Mon, 21 Nov 2022 23:00:10 +1000 Subject: [PATCH] Added Current AcronymBot python file --- Acronymbot.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Acronymbot.py diff --git a/Acronymbot.py b/Acronymbot.py new file mode 100644 index 0000000..5d92dfe --- /dev/null +++ b/Acronymbot.py @@ -0,0 +1,39 @@ +import discord + +from discord import app_commands +from discord.app_commands.errors import CommandInvokeError + + +botIntents = discord.Intents.all() + + +client = discord.Client(intents=botIntents) +tree = app_commands.CommandTree(client) + +@client.event +async def on_ready(): + await tree.sync() + print('Itsa me Mario!') + +@tree.command(name="gibme", description="Lmao") +async def test(interaction:discord.Interaction): + print(f"{interaction.user} used command! Woohoo!") + try: + await interaction.response.send_message("Pay $5 for a Mario Moment", view=Buttons()) + except CommandInvokeError: + print("Uh oh! It failed!") + +class Buttons(discord.ui.View): + def __init__(self, *, timeout=180): + super().__init__(timeout=timeout) + + @discord.ui.button(label="Pay $5", style=discord.ButtonStyle.green) + async def button(self, interaction: discord.Interaction, button: discord.ui.Button): + print(f"{interaction.user} pressed the button") + button.disabled = True + button.label = "No Refunds!" + await interaction.response.edit_message(content=f"Gary is a Capitalist", view=self) + + + +client.run('NzgwNzg4NDIwMjkzMDM0MDA0.GEKkUB.Bbl09D3lWMGea_mcIESPMLUyGlkW-6N53BPFjI') \ No newline at end of file