forked from matteounitn/rappdisibot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
33 lines (28 loc) · 824 Bytes
/
bot.py
File metadata and controls
33 lines (28 loc) · 824 Bytes
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
from pyrogram import Client
import argparse
from plugins import structures
# setto in quale cartella ho i plugins
plugins = dict(
root="plugins"
)
plugins = dict(
root="plugins"
)
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--account', action='store', type=str,
help="set which session are you using")
parser.add_argument('-t', '--token', action='store', type=str,
help="Token to use")
args = parser.parse_args()
if not args.account:
accountname = "my_account"
else:
accountname = args.account
if not args.token:
print("[ERROR] You have to set a token!")
exit(1)
app = Client(accountname, bot_token=args.token,
plugins=plugins) # inizializzo + plugins
print("Avvio bot..")
structures.isBot = True
app.run() # starto l'app