Token in .env
This commit is contained in:
		
							
								
								
									
										1
									
								
								.env.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.env.example
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
TOKEN=''
 | 
			
		||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
.env
 | 
			
		||||
config.yml
 | 
			
		||||
@@ -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)):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user