diff options
author | lexicade <jasonnlelong@gmail.com> | 2023-01-27 21:06:30 +0000 |
---|---|---|
committer | lexicade <jasonnlelong@gmail.com> | 2023-01-27 21:06:30 +0000 |
commit | 52801b4de1d63cd01191acf7fcee137977140ec0 (patch) | |
tree | 08271a1f1e3e8060486b6651c67c9934867c648e /cogs/test.py | |
parent | 8df873808c86805624851356f5dea76ec621de23 (diff) |
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]") |