-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
59 lines (51 loc) · 1.54 KB
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from discord.ext import commands
import logging
log = logging.getLogger()
class Bot(commands.Bot):
def __init__(self, default_extensions, *args, **kwargs):
super().__init__(*args, **kwargs)
for ext in default_extensions:
try:
self.load_extension(ext)
log.info("extension {} successfully loaded".format(ext))
except Exception as e:
log.error(
'Failed to load extension {}. {}: {}'
.format(ext, type(e).__name__, e))
# class FormatHelp():
# def get_ending_note(self):
# command_name = self.context.invoked_with
# return "Tapez {0}{1} <commande> pour plus d'informations sur une commande spécifique.".format(self.clean_prefix, command_name)
# This is ugly.
logging_conf = {
"version": 1,
"formatters": {
"long": {
"format": u"[%(asctime)s] %(levelname)s %(message)s",
"datefmt": u"%m/%d %H:%M:%S"
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "long",
"stream": "ext://sys.stdout"
},
"logfile": {
"class": "logging.FileHandler",
"formatter": "long",
"filename": "client.log",
"encoding": "utf-8"
}
},
"root": {
"handlers": ["console", "logfile"],
"level": "INFO"
},
"loggers": {
"discord": {
"level": "CRITICAL"
}
},
"disable_existing_loggers": False
}