Browse Source

Token in .env

main
Bandie 4 months ago
parent
commit
0a762ebacc
Signed by: Bandie GPG Key ID: 843D7FA93BA46312
3 changed files with 6 additions and 7 deletions
  1. +1
    -0
      .env.example
  2. +2
    -0
      .gitignore
  3. +3
    -7
      TelegramContactProtectionBot.py

+ 1
- 0
.env.example View File

@ -0,0 +1 @@
TOKEN=''

+ 2
- 0
.gitignore View File

@ -0,0 +1,2 @@
.env
config.yml

+ 3
- 7
TelegramContactProtectionBot.py View File

@ -1,7 +1,5 @@
#!/usr/bin/python3
TOKEN=''
from dotenv import dotenv_values
from telegram import Update, Chat, ChatMember, ParseMode, ChatMemberUpdated, BotCommand
from telegram.ext import Updater, CommandHandler, ChatMemberHandler, CallbackContext, MessageHandler, Filters
import telegram
@ -9,17 +7,15 @@ import logging
import os.path
import yaml
TOKEN=dotenv_values()['TOKEN']
configFilename='config.yml'
config = {}
reply_markup = None
bot = telegram.Bot(token=TOKEN)
updater = Updater(token=TOKEN, use_context=True)
dispatcher = updater.dispatcher
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
def loadConfig():
if(os.path.isfile(configFilename)):


Loading…
Cancel
Save