Advertisement
Guest User

updated code auto react discord bot

a guest
May 18th, 2019
1,763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. import discord
  2. from discord.ext    import commands
  3. from discord.ext.commands   import Bot
  4. import asyncio
  5.  
  6. bot = commands.Bot(command_prefix='hello_im_a_prefix')  #change the prefix silly if you want to use commands
  7.  
  8. @bot.event
  9. async def on_ready():
  10.     print ("hello")                                     #change this to whatever you want your bot to say, helps confirm your bot is running as well
  11.  
  12. custom_emojis = [                                       #no longer need the ID for emojis YAY!
  13.     "custom_emoji_1",                                   #make sure you add that ',' if you want more than one emoji // order of appearance is descending   
  14.     "custom_emoji_2"                                    #obvioulsy change custom_emoji to whatever the name of your emoji is on your server
  15. ]
  16.  
  17. async def react(message):                               #however we do need to call those emojis from the server... i mean guild
  18.     for emoji in message.guild.emojis:
  19.         if emoji.name in custom_emojis:
  20.             await message.add_reaction(emoji)
  21.  
  22. @bot.event                                             
  23. async def on_message(message):
  24.     if message.channel.id == "channel_id_here":         #change this as well my dude
  25.         await react(message)
  26.        
  27. bot.run("bot_token")                                    #hope you kept this somwhere safe >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement