Ajout !pinguncon et débuts autres trucs
This commit is contained in:
parent
cdff52af88
commit
571754086a
4 changed files with 30 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
start.sh
|
||||
secrets.txt
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
|
5
db.py
Normal file
5
db.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import psycopg
|
||||
|
||||
#filled in at runtime
|
||||
credentials = ""
|
||||
|
23
ecoplus.py
23
ecoplus.py
|
@ -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
1
start.sh
Normal file
|
@ -0,0 +1 @@
|
|||
python3 ecoplus.py secrets.txt
|
Loading…
Add table
Reference in a new issue