import discord from discord import webhooks from discord.ext.commands import CommandMixin from discord.ext.commands import command from discord.app_commands import commands from discord.ext.buttons import Button from discord import utils class MoneyBot(discord.Client): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.load_extensions("bot/extensions") self.start() @commands.command(name="react_money", description="React with the money emoji when someone says the money emoji.") async def react_money(self, interaction: discord.Interaction): if not isinstance(interaction.user, discord.User): return # Check if the user has already reacted with the money emoji try: reactions = [reaction for reaction in interaction.message.reactions if str(emojis.MONEY) in str(reaction.emoji)] if reactions: return except: pass # If the message hasn't been reacted to yet, add the money emoji if not interactions.message.reactions: await interactions.message.add_reaction(emojis.MONEY) async def main(): bot = MoneyBot() bot.run('YOUR_BOT_TOKEN_HERE') if __name__ == "__main__": import asyncio asyncio.run(main())