34 lines
968 B
Python
34 lines
968 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import logging
|
|
import sys
|
|
|
|
import discord
|
|
|
|
from bot.env_variable import path_log
|
|
from bot.marxbot import MarxBot
|
|
|
|
if __name__ == '__main__':
|
|
# Activating logging
|
|
logging.basicConfig(filename=path_log, filemode="a+", level=logging.INFO,
|
|
format="[%(asctime)s][%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
|
handler = logging.StreamHandler(sys.stdout)
|
|
handler.setLevel(logging.INFO)
|
|
handler.setFormatter(logging.Formatter('[%(asctime)s][%(levelname)s] %(message)s'))
|
|
logging.getLogger().addHandler(handler)
|
|
|
|
# Launching MarxBot
|
|
logging.info("MarxBot is launching.")
|
|
token = sys.argv[1]
|
|
|
|
intents = discord.Intents.all()
|
|
client = MarxBot(dev_marx=False, intents=intents)
|
|
try:
|
|
client.run(token)
|
|
except Exception:
|
|
logging.error("Something went bad !", exc_info=True)
|
|
raise
|
|
logging.info("MarxBot has shutdown.")
|
|
|