added main

This commit is contained in:
TanguyPcFixe 2025-07-14 19:48:47 +02:00
parent 351c7ef6b5
commit c222471302

29
main.py Normal file
View File

@ -0,0 +1,29 @@
import discord
def readToken(filePath):
with open(filePath, 'r') as f:
return f.readline()
intents = discord.Intents.default()
intents.message_content = True
token = readToken("token.token")
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(token)