Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This example requires the 'message_content' intent.
- import discord
- intents = discord.Intents.default()
- intents.message_content = True
- client = discord.Client(intents=intents)
- @client.event
- async def on_ready():
- print(f'We have logged in as {client.user}')
- @client.event
- async def on_message(message):
- if message.author == client.user:
- return
- if message.content.startswith('$hello'):
- await message.channel.send('Hello!')
- client.run('My Bot Token')
Advertisement
Add Comment
Please, Sign In to add comment