irokemr

bot discord responde

Oct 21st, 2021
762
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from discord.ext import commands
  2.  
  3. client = commands.Bot(command_prefix='!')
  4.  
  5. @client.event
  6. async def on_ready():
  7.     print('Bot listo')
  8.  
  9.  
  10. @client.event
  11. async def on_message(message):
  12.     if client.user.id != message.author.id:
  13.         if 'hola' in message.content: #lo que dira la persona
  14.             await message.channel.send(f"{message.author.mention}" +"Que tal estas?") #Lo que dira el bot
  15.  
  16.     await client.process_commands(message)
  17.  
  18. client.run('') #Crear un bot token: https://discord.com/developers/applications
RAW Paste Data