-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscord_bot.py
38 lines (31 loc) · 926 Bytes
/
discord_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
#!python3
# coding: utf-8
"""
Bot main .py file
A small command line utility is available so that the bot's token is not hardcoded in the script
"""
import argparse
import discord
from discord_bot.bot import Bot
if __name__ == "__main__":
# command line handling
cli = argparse.ArgumentParser(description="Run Discord Bot")
cli.add_argument("token", help="Bot token")
cli.add_argument(
"-chromium_args",
action="extend",
nargs="*",
default=[],
help="Chromium extra arguments",
)
cli.add_argument("-isthereanydeal_token", help="IsThereAnyDeal API token")
cli = cli.parse_args()
# run bot
discord.utils.setup_logging()
intents = discord.Intents.default()
intents.message_content = True
Bot(
intents=intents,
chromium_args=cli.chromium_args,
isthereanydeal_token=cli.isthereanydeal_token,
).run(cli.token)