Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 78 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. @bot.message_handler(commands=['kicks'])
  2. def kickearusuario(m):
  3.     adm = ""
  4.     if m.reply_to_message:
  5.         if m.chat.type == "supergroup" or m.chat.type == "group":
  6.             admins = bot.get_chat_administrators(m.chat.id)
  7.             for admin in admins:
  8.                 adm += " " + str(admin.user.id)
  9.  
  10.             if str(m.from_user.id) in adm:
  11.                 try:
  12.                     usuario = m.reply_to_message.from_user.id
  13.                     bot.kick_chat_member(m.chat.id, usuario)
  14.                     bot.unban_chat_member(m.chat.id, usuario)
  15.                     bot.send_message(m.chat.id, m.reply_to_message.from_user.first_name + " Expulsado")
  16.                 except Exception as e:
  17.                     bot.reply_to(m, "Error no se pudo kickear el usuario")
  18.             else:
  19.                 bot.reply_to(m, "No eres administrador")
  20.         else:
  21.             bot.reply_to(m.chat.id, "Funcion no disponible en privado")
  22.     else:
  23.         bot.reply_to(m.chat.id, "Debes responder a un usuario")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top