Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion TeleGatherer.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ def add_token_and_chat_id_to_file(file_path, bot_token, chat_id):

file_path = ".bot-history" # Replace with the actual file path

# Remove possible keyword "bot" before the token
if args.bot_token.startswith("bot"):
args.bot_token = args.bot_token[3:]

if check_file_for_token_and_chat_id(file_path, args.bot_token, args.chat_id):
print("Bot token and chat ID pair already exists in the file.")
response = input("Are you sure you want to continue? (y/n): ")
Expand All @@ -258,4 +262,4 @@ def add_token_and_chat_id_to_file(file_path, bot_token, chat_id):
else:
add_token_and_chat_id_to_file(file_path, args.bot_token, args.chat_id)

main(args.bot_token, args.chat_id)
main(args.bot_token, args.chat_id)