mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-11-04 07:22:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			523 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			523 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import discord
 | 
						|
 | 
						|
class MyClient(discord.Client):
 | 
						|
    async def on_ready(self):
 | 
						|
        print('Logged in as')
 | 
						|
        print(self.user.name)
 | 
						|
        print(self.user.id)
 | 
						|
        print('------')
 | 
						|
 | 
						|
    async def on_message(self, message):
 | 
						|
        # we do not want the bot to reply to itself
 | 
						|
        if message.author.id == self.user.id:
 | 
						|
            return
 | 
						|
 | 
						|
        if message.content.startswith('!hello'):
 | 
						|
            await message.channel.send('Hello {0.author.mention}'.format(message))
 | 
						|
 | 
						|
client = MyClient()
 | 
						|
client.run('token')
 |