Skip to content

Instantly share code, notes, and snippets.

@Tester2009
Last active May 20, 2017 19:24
Show Gist options
  • Save Tester2009/9cf98f34396fbb4ba77a19130700075c to your computer and use it in GitHub Desktop.
Save Tester2009/9cf98f34396fbb4ba77a19130700075c to your computer and use it in GitHub Desktop.
Communicate with authorized user only
# Made by fb.com/Tester2009 [ Hakase ]
# github: https://github.com/alepcat1710
# May 17, 2017
#
# Use this code to build a better world
# Simply credit to me @tester2009.
#
import telebot
API_TOKEN = ''
bot = telebot.TeleBot(API_TOKEN)
uid_list = [] # store user id here.
@bot.message_handler(commands=['id'])
def check_id(message):
g_id = message.chat.id # this is chat/group id
u_id = message.from_user.id # this is user/personal id
if u_id in uid_list:
bot.reply_to(message, "Hello there")
else:
bot.reply_to(message, "Unauthorized user lolz")
bot.polling()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment