-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
48 lines (43 loc) · 1.04 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
import argparse
from telebot import TeleBot
from command import register_commands
import context
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'--tg_token',
type=str,
required=True,
help="The token of your telegram bot",
)
parser.add_argument(
'--access_key',
type=str,
required=True,
help="Specify Access Key to use this bot",
)
parser.add_argument(
'--cookie_file',
type=str,
required=False,
help="Path of your cookie file",
)
parser.add_argument(
'--proxy',
type=str,
required=False,
help="proxy server, e.g. http://127.0.0.1:7890",
)
parser.add_argument(
'--locale',
type=str,
required=False,
help="the locale of the proxy server, e.g. en-US",
)
options = parser.parse_args()
context.init(options)
bot = TeleBot(options.tg_token)
register_commands(bot)
bot.infinity_polling()
if __name__ == "__main__":
main()