Ajout !pinguncon et débuts autres trucs

This commit is contained in:
attilavs2 2024-02-22 19:43:30 +01:00
parent cdff52af88
commit 571754086a
4 changed files with 30 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
start.sh
secrets.txt
# Byte-compiled / optimized / DLL files
__pycache__/

5
db.py Normal file
View file

@ -0,0 +1,5 @@
import psycopg
#filled in at runtime
credentials = ""

View file

@ -1,6 +1,18 @@
import sys
import discord
import db
secrets_file = open(sys.argv[1], mode="rt")
secrets = secrets_file.read()
secrets = secrets.split(";")
token = secrets[0]
db.credentials = secrets[1]
intents = discord.Intents.default()
intents.message_content = True
@ -15,7 +27,12 @@ async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
content = message.content
client.run(str(sys.argv[1]))
if content == "!hello":
await message.channel.send('henlo')
return
if content == "!pinguncon":
await message.channel.send("<499533339468759052>")
client.run(token)

1
start.sh Normal file
View file

@ -0,0 +1 @@
python3 ecoplus.py secrets.txt