defined docker file and added demo test script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cisco 2023-01-03 22:40:31 +01:00
parent f421668a69
commit 9f7183e955
2 changed files with 29 additions and 0 deletions

6
Dockerfile Normal file
View file

@ -0,0 +1,6 @@
FROM python:3.10
# Or any preferred Python version.
ADD example_bot.py .
RUN pip install discord.py
CMD [python, ./example_bot.py]
# Or enter the name of your unique directory and parameter set.

23
example_bot.py Normal file
View file

@ -0,0 +1,23 @@
# 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'))