Discord_test/example_bot.py
cisco 9f7183e955
All checks were successful
continuous-integration/drone/push Build is passing
defined docker file and added demo test script
2023-01-03 22:40:31 +01:00

23 lines
No EOL
503 B
Python

# This example requires the 'message_content' intent.
import discord
import os
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 cisco!')
client.run(os.getenv('TOKEN'))