Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Eugene-Chatbot/discord attempt2.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (14 sloc)
756 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Code taken from https://github.com/Rapptz/discord.py | |
import discord | |
class MyClient(discord.Client): | |
async def on_ready(self): | |
print('Logged in as') | |
print(self.user.name) #Adapted code here to allow different things to be printed on the screen | |
print(self.user.id) | |
print('------') | |
async def on_message(self, message): | |
# we do not want the bot to reply to itself | |
if message.content.startswith('!hello'): #Adapted code here and used a different format | |
await message.channel.send('Hello {0.author.mention}'.format(message)) | |
client = MyClient() | |
client.run('NjM1NDY4MDIwNzM4OTQ5MTIw.Xa2oDA.BYP9xBMF4__3_0RZfe5XtNq6OOo') |