add config file in args
This commit is contained in:
parent
1861f39450
commit
e391b138e5
1 changed files with 10 additions and 1 deletions
|
@ -15,6 +15,7 @@ import random
|
|||
import requests
|
||||
import youtube_dl
|
||||
import configparser
|
||||
import argparse
|
||||
|
||||
from bs4 import BeautifulSoup as bs
|
||||
from discord.ext import tasks, commands
|
||||
|
@ -540,8 +541,16 @@ def get_word(word_type):
|
|||
#Le do[main]e de Kabot.
|
||||
def main():
|
||||
logger.info("Initialisation de Kabot")
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--config",
|
||||
help="config file",
|
||||
default="config.ini"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
config.read(args.config)
|
||||
audio_path = config['DEFAULT']['audio_path']
|
||||
token = config['discord']['token']
|
||||
gl_url = config['gitlab']['url']
|
||||
|
|
Loading…
Reference in a new issue