forked from chamburr/modmail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (34 loc) · 1.05 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
import asyncio
import logging
import sys
import sentry_sdk
import config
from classes.bot import ModMail
from utils import tools
if config.testing is False:
sentry_sdk.init(config.sentry_url)
cluster_id = int(sys.argv[1])
cluster_count = int(sys.argv[2])
bot_id = int(sys.argv[3])
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename=f"logs/cluster-{cluster_id}.log", encoding="utf-8", mode="w")
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
logger.addHandler(handler)
log = logging.getLogger(__name__)
async def command_prefix(bot2, message):
prefix = await tools.get_guild_prefix(bot2, message.guild)
return [f"<@{bot.id}> ", f"<@!{bot.id}> ", prefix]
bot = ModMail(
command_prefix=command_prefix,
bot_id=bot_id,
cluster_id=cluster_id,
cluster_count=cluster_count,
version="3.0.0",
)
@bot.event
async def on_message(_):
pass
loop = asyncio.get_event_loop()
loop.run_until_complete(bot.start())