Setup and Config Structure

This commit is contained in:
fanyx 2020-11-13 01:49:39 +01:00
parent 25a742967c
commit 8897408184
6 changed files with 36 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
venv

8
config.ini Normal file
View File

@ -0,0 +1,8 @@
[AUTH]
token =
[BOT]
name =
[DEBUG]
loglevel = WARNING

21
main.py Normal file
View File

@ -0,0 +1,21 @@
from configparser import ConfigParser
import logging
from discord import Client
import sys
# read config at default location
# ./config.ini
config = ConfigParser()
try:
config.read_file(open("config.ini"))
except FileNotFoundError:
logging.critical("Unable to locate the configuration file.")
sys.exit(1)
# spawn discord client instance
# init token from config
bot = Client()
token = config['AUTH']['token']
if __name__ == "__main__":
bot.run()

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
# Discord API Wrapper
discord.py == 1.5.1
# Database ORM
peewee == 3.14.0
# Language detection
langdetect == 1.0.8

0
src/commands/__init__.py Normal file
View File

0
src/database/__init__.py Normal file
View File