Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

discord py bot example

import discord

token = ''

# Simple Echo Bot

class MyClient(discord.client):

	async def on_ready(self):
    	print(f'Logged on as {self.user}!')
    
    async def on_message(self, message):
    	if message.author == self.user: return
        await message.reply(message.content)

# Need to enable intents in bot settings
intents = discord.Intents().all()
client = MyClient(intents=intents)

client.run(token)
 
PREVIOUS NEXT
Tagged: #discord #py #bot
ADD COMMENT
Topic
Name
2+3 =