first
This commit is contained in:
22
bot.py
Normal file
22
bot.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from tg_bot import run
|
||||
|
||||
TG_BOT_TOKEN = "8355194422:AAG0LkYBuclLu6EYzG7gKq2np5233WTTfgk"
|
||||
TG_ALLOWED_USER_IDS = None # 改成你的 user_id;想放开就设为 None
|
||||
TG_ALLOW_GROUPS = False
|
||||
|
||||
|
||||
def main() -> None:
|
||||
token = TG_BOT_TOKEN.strip()
|
||||
if not token or token == "PASTE_YOUR_BOT_TOKEN_HERE":
|
||||
raise SystemExit("Please set TG_BOT_TOKEN in bot.py")
|
||||
|
||||
allowed = TG_ALLOWED_USER_IDS
|
||||
if allowed is not None and not isinstance(allowed, set):
|
||||
raise SystemExit("TG_ALLOWED_USER_IDS must be a set[int] or None")
|
||||
|
||||
run(token=token, allowed_user_ids=allowed, allow_groups=TG_ALLOW_GROUPS)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user