Guest User

Untitled

a guest
Feb 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. from disco.bot import Bot, Plugin
  2.  
  3. class ThePlugin(Plugin):
  4. # Plugins provide an easy interface for listening to Discord events
  5. @Plugin.listen('ChannelCreate')
  6. def on_channel_create(self, event):
  7. event.channel.send_message('Woah, a new channel huh!')
  8.  
  9. # They also provide an easy-to-use command component
  10. @Plugin.command('ping')
  11. def on_ping_command(self, event):
  12. event.msg.reply('Pong!')
  13.  
  14. # Which includes command argument parsing
  15. @Plugin.command('echo', '<content:str...>')
  16. def on_echo_command(self, event, content):
  17. event.msg.reply(content)
Add Comment
Please, Sign In to add comment