-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
62 lines (53 loc) · 1.9 KB
/
main.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
60
61
62
"""
laythe-v2
Copyright (C) 2022 CodeNU
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
import logging
import os
import sys
from dico import __version__ as dico_version
from dico_command import __version__ as command_version
from dico_interaction import __version__ as interaction_version
from laythe import LaytheBot
print(
r"""
_ _ _
| | | | | |
| | __ _ _ _ | |_ | |__ ___
| | / _` || | | || __|| '_ \ / _ \
| |____| (_| || |_| || |_ | | | || __/
\_____/ \__,_| \__, | \__||_| |_| \___|
__/ |
|___/
"""
)
print(
f"""Laythe v2
Powered by dico {dico_version}, dico-command {command_version}, and dico-interaction {interaction_version}.
Please wait..."""
)
logger = logging.getLogger("laythe")
logging.basicConfig(level=logging.DEBUG) # DEBUG/INFO/WARNING/ERROR/CRITICAL
handler = logging.FileHandler(filename="laythe.log", encoding="utf-8", mode="w")
handler.setFormatter(
logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s")
)
logger.addHandler(handler)
bot = LaytheBot(logger=logger)
[
bot.load_module(f"addons.{x[:-3]}")
for x in os.listdir("addons")
if not x.startswith("_")
]
bot.load_module("dp")
bot.run()