Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This is an example of using python to add
- a robot into a discord server. To be used
- with my turtorial that I gave to my students.
- """
- #Install these packages with pip or git if not using repl.it
- import discord
- import os
- client = discord.Client()
- @client.event
- async def on_ready():
- print('We have logged in as {0.user}'.format(client))
- @client.event
- async def on_message(msg):
- #Check to make sure it's not the Robot sending the message
- if msg.author == client.user:
- return
- if msg.content.startswith('CVHS'):
- await msg.channel.send("CVHS ROCKS!!!!")
- client.run(os.getenv('token'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement