Setup and Config Structure
This commit is contained in:
parent
25a742967c
commit
8897408184
|
@ -0,0 +1 @@
|
|||
venv
|
|
@ -0,0 +1,8 @@
|
|||
[AUTH]
|
||||
token =
|
||||
|
||||
[BOT]
|
||||
name =
|
||||
|
||||
[DEBUG]
|
||||
loglevel = WARNING
|
|
@ -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()
|
|
@ -0,0 +1,6 @@
|
|||
# Discord API Wrapper
|
||||
discord.py == 1.5.1
|
||||
# Database ORM
|
||||
peewee == 3.14.0
|
||||
# Language detection
|
||||
langdetect == 1.0.8
|
Loading…
Reference in New Issue