diff options
Diffstat (limited to 'cogs/test.py')
-rw-r--r-- | cogs/test.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/cogs/test.py b/cogs/test.py new file mode 100644 index 0000000..ab395f2 --- /dev/null +++ b/cogs/test.py @@ -0,0 +1,47 @@ +import asyncio +import datetime + +from discord.ext import commands +import discord +import re +import upsidedown +import importlib +import utils +importlib.reload(utils) + + +class Test(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def test(self, ctx): + """testing""" + components = discord.ui.MessageComponents( + discord.ui.ActionRow( + discord.ui.Button(label="Do not click me", custom_id="bad_touch", style=discord.ButtonStyle.red) + ), + discord.ui.ActionRow( + discord.ui.Button(label="Click me", custom_id="good_touch", style=discord.ButtonStyle.green) + ), + ) + sent_message: discord.Message = await ctx.send("Do not press this button", components=components) + + def check(interaction: discord.Interaction): + return True + + interaction: discord.Interaction = await self.bot.wait_for("component_interaction", check=check) + if interaction.component.custom_id == "bad_touch": + await interaction.message.reply(content=f"{interaction.user.mention} is a nonce!") + else: + await interaction.message.reply(content=f"{interaction.user.mention} is an egg!") + + +def setup(bot): + print("INFO: Loading [Test]... ", end="") + bot.add_cog(Test(bot)) + print("Done!") + + +def teardown(bot): + print("INFO: Unloading [Test]") |