コード例 #1
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def join_fed(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    message = update.effective_message
    administrators = chat.get_administrators()
    fed_id = sql.get_fed_id(chat.id)


    if user.id in SUDO_USERS:
        pass
    else:
        for admin in administrators:
            status = admin.status
            if status == "creator":
                print(admin)
                if str(admin.user.id) == str(user.id):
                    pass
                else:
                    update.effective_message.reply_text(tld(chat.id, "Only group creator can do it!"))
                    return
    if fed_id:
        message.reply_text(tld(chat.id, "Uh, Are you gonna join two federations at one chat?"))
        return

    if len(args) >= 1:
        sql.chat_join_fed(args[0], chat.id)
        message.reply_text(tld(chat.id, "Chat joined to federation!"))
コード例 #2
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def leave_fed(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    administrators = chat.get_administrators()

    if user.id in SUDO_USERS:
        pass
    else:
        for admin in administrators:
            status = admin.status
            if status == "creator":
                print(admin)
                if str(admin.user.id) == str(user.id):
                    pass
                else:
                    update.effective_message.reply_text(
                        "Only group creator can do it!")
                    return

    if sql.chat_leave_fed(chat.id) == True:
        update.effective_message.reply_text("Leaved from fed!")
    else:
        update.effective_message.reply_text("Error!")
コード例 #3
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def set_frules(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text("Only fed admins can do this!")
        return

    if len(args) >= 1:
        msg = update.effective_message  # type: Optional[Message]
        raw_text = msg.text
        args = raw_text.split(
            None, 1)  # use python's maxsplit to separate cmd and args
        if len(args) == 2:
            txt = args[1]
            offset = len(txt) - len(
                raw_text)  # set correct offset relative to command
            markdown_rules = markdown_parser(txt,
                                             entities=msg.parse_entities(),
                                             offset=offset)
        sql.set_frules(fed_id, markdown_rules)
        update.effective_message.reply_text("Rules setuped for this fed!")
    else:
        update.effective_message.reply_text("Please write rules!")
コード例 #4
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def fed_admin(bot: Bot, update: Update, args: List[str]):

        chat = update.effective_chat  # type: Optional[Chat]
        user = update.effective_user  # type: Optional[User]
        fed_id = sql.get_fed_id(chat.id)

        if not fed_id:
            update.effective_message.reply_text(tld(chat.id, "This group not in any federation!"))
            return

        if is_user_fed_admin(fed_id, user.id) == False:
            update.effective_message.reply_text(tld(chat.id, "Only fed admins can do this!"))
            return

        print(fed_id)
        user = update.effective_user  # type: Optional[Chat]
        chat = update.effective_chat  # type: Optional[Chat]
        info = sql.get_fed_info(fed_id)

        text = "\n\n<b>Federation Admins:</b>"
        user = bot.get_chat(info.owner_id) 
        text += "\n• {} - <code>{}</code> (Creator)".format(mention_html(user.id, user.first_name), user.id)

        h = sql.all_fed_users(fed_id)
        for O in h:
                user = bot.get_chat(O) 
                text += "\n• {} - <code>{}</code>".format(mention_html(user.id, user.first_name), user.id, O)

        update.effective_message.reply_text(text, parse_mode=ParseMode.HTML)
コード例 #5
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def get_frules(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    fed_id = sql.get_fed_id(chat.id)
    rules = sql.get_frules(fed_id).rules
    print(rules)
    text = "*Rules in this fed:*\n"
    text += rules
    update.effective_message.reply_text(tld(chat.id, text), parse_mode=ParseMode.MARKDOWN)
コード例 #6
0
ファイル: feds.py プロジェクト: preetk10/IronHyde-Bot
def user_join_fed(bot: Bot, update: Update, args: List[str]):

    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_owner(fed_id, user.id) == False:
        update.effective_message.reply_text(
            tld(chat.id, "Only fed owner can do this!"))
        return

    msg = update.effective_message  # type: Optional[Message]
    user_id = extract_user(msg, args)
    if user_id:
        user = bot.get_chat(user_id)

    elif not msg.reply_to_message and not args:
        user = msg.from_user

    elif not msg.reply_to_message and (
            not args or
        (len(args) >= 1 and not args[0].startswith("@")
         and not args[0].isdigit()
         and not msg.parse_entities([MessageEntity.TEXT_MENTION]))):
        msg.reply_text(tld(chat.id, "I can't extract a user from this."))
        return

    else:
        return

    print(sql.search_user_in_fed(fed_id, user_id))

    if is_user_fed_owner(fed_id, user.id) == True:
        update.effective_message.reply_text(
            tld(chat.id, "Are you gonna promote yourself?"))
        return

    elif not sql.search_user_in_fed(fed_id, user_id) == False:
        update.effective_message.reply_text(
            tld(
                chat.id,
                "I can't promote user which is already a fed admin! But I can demote them."
            ))
        return

    if user_id == bot.id:
        update.effective_message.reply_text(
            tld(
                chat.id,
                "I am already the federation admin and the one that manage it!"
            ))
        return

    #else:
    #        return

    res = sql.user_join_fed(fed_id, user_id)
    update.effective_message.reply_text(tld(chat.id, "Promoted Successfully!"))
コード例 #7
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def fed_ban(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text("Only fed admins can do this!")
        return

    message = update.effective_message  # type: Optional[Message]

    user_id, reason = extract_user_and_text(message, args)

    if not user_id:
        message.reply_text("You don't seem to be referring to a user.")
        return

    if user_id == bot.id:
        message.reply_text(
            "You can't fban me, better hit your head against the wall, it's more fun."
        )
        return

    try:
        user_chat = bot.get_chat(user_id)
    except BadRequest as excp:
        message.reply_text(excp.message)
        return

    if user_chat.type != 'private':
        message.reply_text("That's not a user!")
        return

    message.reply_text("Start fbanning!")

    if reason == "":
        reason = "no reason"

    sql.fban_user(fed_id, user_id, reason)

    h = sql.all_fed_chats(fed_id)
    for O in h:
        try:
            bot.kick_chat_member(O, user_id)
            #text = tld(chat.id, "I should gban {}, but it's only test fban, right? So i let him live.").format(O)
            text = "Fbanning {}".format(user_id)
            #message.reply_text(text)
        except BadRequest as excp:
            if excp.message in FBAN_ERRORS:
                pass
            else:
                message.reply_text("Could not fban due to: {}").format(
                    excp.message)
                return
        except TelegramError:
            pass
コード例 #8
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def fed_info(bot: Bot, update: Update, args: List[str]):

    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if not fed_id:
        update.effective_message.reply_text(
            "This group not in any federation!")
        return

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text("Only fed admins can do this!")
        return

    print(fed_id)
    user = update.effective_user  # type: Optional[Chat]
    chat = update.effective_chat  # type: Optional[Chat]
    info = sql.get_fed_info(fed_id)

    text = "<b>Federation INFO:</b>"
    text += "\nName: <code>{}</code>".format(info.fed_name)
    text += "\nID: <code>{}</code>".format(fed_id)

    R = 0
    for O in sql.get_all_fban_users(fed_id):
        R = R + 1

    text += "\nBanned: <code>{}</code>".format(R)
    text += "\n\n<b>Chats:</b>"
    h = sql.all_fed_chats(fed_id)
    for O in h:
        cht = bot.get_chat(O)
        text += "\n• {} (<code>{}</code>)".format(cht.title, O)

    text += "\n\n<b>Admins:</b>"
    user = bot.get_chat(info.owner_id)
    text += "\n• {} - <code>{}</code> (Creator)".format(
        user.first_name, user.id)

    h = sql.all_fed_users(fed_id)
    for O in h:
        user = bot.get_chat(O)
        text += "\n• {} - <code>{}</code>".format(user.first_name, user.id, O)

    # Chance 1/5 to add this string to /fedinfo
    # You can remove this or reduce the percentage, but if you really like my work leave this.
    num = random.randint(1, 5)
    print("random ", num)
    if num == 3:
        text += "\n\nFederation by MrYacha for YanaBot"

    update.effective_message.reply_text(text, parse_mode=ParseMode.HTML)
コード例 #9
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def welcome_fed(bot, update):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]

    fed_id = sql.get_fed_id(chat.id)
    fban = fban = sql.get_fban_user(fed_id, user.id)
    if not fban == False:
        update.effective_message.reply_text(tld(chat.id, "This user is banned in current federation! I will remove him."))
        bot.kick_chat_member(chat.id, user.id)
        return True
    else:
        return False
コード例 #10
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def __user_info__(user_id, chat_id):
    fed_id = sql.get_fed_id(chat_id)
    if fed_id:
        fban = sql.get_fban_user(fed_id, user_id)
        if not fban == False:
            text = "Banned in current federation - <b>Yes</b>"
            text += "\n<b>Reason:</b> {}".format(fban)
        else:
            text = "Banned in current federation - <b>No</b>"
    else:
        text = ""
    return text
コード例 #11
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def unfban(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    message = update.effective_message  # type: Optional[Message]
    fed_id = sql.get_fed_id(chat.id)

    user_id = extract_user(message, args)
    if not user_id:
        message.reply_text("You don't seem to be referring to a user.")
        return

    user_chat = bot.get_chat(user_id)
    if user_chat.type != 'private':
        message.reply_text("That's not a user!")
        return

    if sql.get_fban_user(fed_id, user_id) == False:
        message.reply_text("This user is not gbanned!")
        return

    banner = update.effective_user  # type: Optional[User]

    message.reply_text(
        "I'll give {} a second chance in this federation.").format(
            user_chat.first_name)

    h = sql.all_fed_chats(fed_id)

    for O in h:
        try:
            member = bot.get_chat_member(O, user_id)
            if member.status == 'kicked':
                bot.unban_chat_member(O, user_id)

        except BadRequest as excp:

            if excp.message in UNFBAN_ERRORS:
                pass
            else:
                message.reply_text("Could not un-fban due to: {}").format(
                    excp.message)
                return

        except TelegramError:
            pass

        try:
            sql.un_fban_user(fed_id, user_id)
        except:
            pass

    message.reply_text("Person has been un-fbanned.")
コード例 #12
0
ファイル: feds.py プロジェクト: preetk10/IronHyde-Bot
def user_demote_fed(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_owner(fed_id, user.id) == False:
        update.effective_message.reply_text(
            tld(chat.id, "Only fed owner can do this!"))
        return

    msg = update.effective_message  # type: Optional[Message]
    user_id = extract_user(msg, args)
    if user_id:
        user = bot.get_chat(user_id)

    elif not msg.reply_to_message and not args:
        user = msg.from_user

    elif not msg.reply_to_message and (
            not args or
        (len(args) >= 1 and not args[0].startswith("@")
         and not args[0].isdigit()
         and not msg.parse_entities([MessageEntity.TEXT_MENTION]))):
        msg.reply_text(tld(chat.id, "I can't extract a user from this."))
        return

    #else:
    #        return

    if user_id == bot.id:
        update.effective_message.reply_text(
            tld(
                chat.id,
                "What are you trying to do? Demoting me from your federation?")
        )
        return

    if sql.search_user_in_fed(fed_id, user_id) == False:
        update.effective_message.reply_text(
            tld(
                chat.id,
                "I can't demote user which not a fed admin! If you wanna bring him to tears, promote him first!"
            ))
        return

    res = sql.user_demote_fed(fed_id, user_id)
    if res == True:
        update.effective_message.reply_text(tld(chat.id, "Get out of here!"))
    else:
        update.effective_message.reply_text(
            tld(chat.id, "I can not remove him, I am powerless!"))
コード例 #13
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def del_fed(bot: Bot, update: Update, args: List[str]):

        chat = update.effective_chat  # type: Optional[Chat]
        user = update.effective_user  # type: Optional[User]
        fed_id = sql.get_fed_id(chat.id)

        if not fed_id:
            update.effective_message.reply_text(tld(chat.id, "At the moment, We only supported deleting federation on the group that joined it."))
            return

        if not is_user_fed_owner(fed_id, user.id):
            update.effective_message.reply_text(tld(chat.id, "Only fed owner can do this!"))
            return

        sql.del_fed(fed_id, chat.id)
        update.effective_message.reply_text(tld(chat.id, "Deleted!"))
コード例 #14
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def broadcast(bot: Bot, update: Update, args: List[str]):
    to_send = update.effective_message.text.split(None, 1)
    if len(to_send) >= 2:
        chat = update.effective_chat  # type: Optional[Chat]
        fed_id = sql.get_fed_id(chat.id)
        chats = sql.all_fed_chats(fed_id)
        failed = 0
        for Q in chats:
            try:
                bot.sendMessage(Q, to_send[1])
                sleep(0.1)
            except TelegramError:
                failed += 1
                LOGGER.warning("Couldn't send broadcast to %s, group name %s", str(chat.chat_id), str(chat.chat_name))

        update.effective_message.reply_text(tld(chat.id, "Federations Broadcast complete. {} groups failed to receive the message, probably "
                                            "due to left federation.").format(failed))
コード例 #15
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def del_fed(bot: Bot, update: Update, args: List[str]):

    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_owner(fed_id, user.id) == False:
        update.effective_message.reply_text("Only fed owner can do this!")
        return

    if len(args) >= 1:
        fed_id = args[0]
        sql.del_fed(fed_id, chat.id)
        update.effective_message.reply_text("Deleted!")
    else:
        update.effective_message.reply_text(
            "Please write federation id to remove!")
コード例 #16
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def fed_chat(bot: Bot, update: Update, args: List[str]):
        chat = update.effective_chat  # type: Optional[Chat]
        user = update.effective_user  # type: Optional[User]
        fed_id = sql.get_fed_id(chat.id)

        if not fed_id:
            update.effective_message.reply_text(tld(chat.id, "This group not in any federation!"))
            return

        print(fed_id)
        user = update.effective_user  # type: Optional[Chat]
        chat = update.effective_chat  # type: Optional[Chat]
        info = sql.get_fed_info(fed_id)

        text = "This chat is part of the following federation:"
        text += "\n{} (ID: <code>{}</code>)".format(info.fed_name, fed_id)

        update.effective_message.reply_text(text, parse_mode=ParseMode.HTML)
コード例 #17
0
ファイル: feds.py プロジェクト: preetk10/IronHyde-Bot
def fed_info(bot: Bot, update: Update, args: List[str]):

    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)
    info = sql.get_fed_info(fed_id)

    if not fed_id:
        update.effective_message.reply_text(
            tld(chat.id, "This group not in any federation!"))
        return

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text(
            tld(chat.id, "Only fed admins can do this!"))
        return

    OW = bot.get_chat(info.owner_id)
    HAHA = OW.id
    FEDADMIN = sql.all_fed_users(fed_id)
    FEDADMIN.append(int(HAHA))
    ACTUALADMIN = len(FEDADMIN)

    print(fed_id)
    user = update.effective_user  # type: Optional[Chat]
    chat = update.effective_chat  # type: Optional[Chat]
    info = sql.get_fed_info(fed_id)

    text = "<b>Fed info:</b>"
    text += "\nFedID: <code>{}</code>".format(fed_id)
    text += "\nName: {}".format(info.fed_name)
    text += "\nCreator: {}".format(mention_html(HAHA, "this guy"))
    text += "\nNumber of admins: <code>{}</code>".format(ACTUALADMIN)
    R = 0
    for O in sql.get_all_fban_users(fed_id):
        R = R + 1

    text += "\nNumber of bans: <code>{}</code>".format(R)
    h = sql.all_fed_chats(fed_id)
    asdf = len(h)
    text += "\nNumber of connected chats: <code>{}</code>".format(asdf)

    update.effective_message.reply_text(text, parse_mode=ParseMode.HTML)
コード例 #18
0
ファイル: feds.py プロジェクト: anandps002/IronHyde-Bot
def user_join_fed(bot: Bot, update: Update, args: List[str]):

    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)

    if is_user_fed_owner(fed_id, user.id) == False:
        update.effective_message.reply_text("Only fed owner can do this!")
        return

    msg = update.effective_message  # type: Optional[Message]
    user_id = extract_user(msg, args)
    if user_id:
        user = bot.get_chat(user_id)

    elif not msg.reply_to_message and not args:
        user = msg.from_user

    elif not msg.reply_to_message and (
            not args or
        (len(args) >= 1 and not args[0].startswith("@")
         and not args[0].isdigit()
         and not msg.parse_entities([MessageEntity.TEXT_MENTION]))):
        msg.reply_text("I can't extract a user from this.")
        return

    else:
        return

    print(sql.search_user_in_fed(fed_id, user_id))

    if not sql.search_user_in_fed(fed_id, user_id) == False:
        update.effective_message.reply_text(
            "I can't promote user which already a fed admin! But I can demote him."
        )
        return

    res = sql.user_join_fed(fed_id, user_id)
    update.effective_message.reply_text("Joined to fed!")
コード例 #19
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def unfban(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    message = update.effective_message  # type: Optional[Message]
    fed_id = sql.get_fed_id(chat.id)
    info = sql.get_fed_info(fed_id)

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text(tld(chat.id, "Only fed admins can do this!"))
        return

    user_id = extract_user(message, args)
    if not user_id:
        message.reply_text(tld(chat.id, "You don't seem to be referring to a user."))
        return

    user_chat = bot.get_chat(user_id)
    if user_chat.type != 'private':
        message.reply_text(tld(chat.id, "That's not a user!"))
        return

    if sql.get_fban_user(fed_id, user_id) == False:
        message.reply_text(tld(chat.id, "This user is not fbanned!"))
        return

    banner = update.effective_user  # type: Optional[User]

    message.reply_text(tld(chat.id, "I'll give {} a second chance in this federation.").format(user_chat.first_name))

    h = sql.all_fed_chats(fed_id)

    for O in h:
        try:
            member = bot.get_chat_member(O, user_id)
            if member.status == 'kicked':
                bot.unban_chat_member(O, user_id)

        
        except BadRequest as excp:

            if excp.message in UNFBAN_ERRORS:
                pass
            else:
                message.reply_text(tld(chat.id, "Could not un-fban due to: {}").format(excp.message))
                return

        except TelegramError:
            pass
        
        try:
            sql.un_fban_user(fed_id, user_id)
        except:
            pass

    message.reply_text(tld(chat.id, "Person has been un-fbanned."))

    OW = bot.get_chat(info.owner_id)
    HAHA = OW.id
    FEDADMIN = sql.all_fed_users(fed_id)
    FEDADMIN.append(int(HAHA))

    send_to_list(bot, FEDADMIN,
             "<b>Un-FedBan</b>" \
             "\n<b>Fed:</b> {}" \
             "\n<b>FedAdmin:</b> {}" \
             "\n<b>User:</b> {}" \
             "\n<b>User ID:</b> <code>{}</code>".format(info.fed_name, mention_html(user.id, user.first_name),
                                                 mention_html(user_chat.id, user_chat.first_name),
                                                              user_chat.id),
            html=True)
コード例 #20
0
ファイル: feds.py プロジェクト: preetk10/ThaNos
def fed_ban(bot: Bot, update: Update, args: List[str]):
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]
    fed_id = sql.get_fed_id(chat.id)
    info = sql.get_fed_info(fed_id)
    OW = bot.get_chat(info.owner_id)
    HAHA = OW.id
    FEDADMIN = sql.all_fed_users(fed_id)
    FEDADMIN.append(int(HAHA))

    if is_user_fed_admin(fed_id, user.id) == False:
        update.effective_message.reply_text(tld(chat.id, "Only fed admins can do this!"))
        return

    message = update.effective_message  # type: Optional[Message]

    user_id, reason = extract_user_and_text(message, args)

    if not user_id:
        message.reply_text(tld(chat.id, "You don't seem to be referring to a user."))
        return

    if user_id == bot.id:
        message.reply_text(tld(chat.id, "You can't fban me, better hit your head against the wall, it's more fun."))
        return

    if is_user_fed_owner(fed_id, user_id) == True:
        message.reply_text(tld(chat.id, "Why you are trying to fban the federation owner?"))
        return

    if is_user_fed_admin(fed_id, user_id) == True:
        message.reply_text(tld(chat.id, "Why so serious trying to fban the federation admin?"))
        return

    if user_id == OWNER_ID:
        message.reply_text(tld(chat.id, "I'm not fbanning my master, That's pretty dumb idea!"))
        return

    if int(user_id) in SUDO_USERS:
        message.reply_text(tld(chat.id, "I'm not fbanning the bot sudoers!"))
        return

    if int(user_id) in WHITELIST_USERS:
        message.reply_text(tld(chat.id, "This person is whitelist from being fbanned!"))
        return

    try:
        user_chat = bot.get_chat(user_id)
    except BadRequest as excp:
        message.reply_text(excp.message)
        return

    if user_chat.type != 'private':
        message.reply_text(tld(chat.id, "That's not a user!"))
        return


    message.reply_text(tld(chat.id, "Start fbanning!"))

    if reason == "":
        message.reply_text(tld(chat.id, "You have entered no reason, fbanning without reason!"))
        reason = "No Reason have been given"

    sql.fban_user(fed_id, user_id, reason)

    h = sql.all_fed_chats(fed_id)
    for O in h:
        try:
            bot.kick_chat_member(O, user_id)
            #text = tld(chat.id, "I should gban {}, but it's only test fban, right? So i let him live.").format(O)
            text = "Fbanning {}".format(user_id)
            #message.reply_text(text)
        except BadRequest as excp:
            if excp.message in FBAN_ERRORS:
                pass
            else:
                message.reply_text(tld(chat.id, "Could not fban due to: {}").format(excp.message))
                return
        except TelegramError:
            pass

    send_to_list(bot, FEDADMIN,
             "<b>New FedBan</b>" \
             "\n<b>Fed:</b> {}" \
             "\n<b>FedAdmin:</b> {}" \
             "\n<b>User:</b> {}" \
             "\n<b>User ID:</b> <code>{}</code>" \
             "\n<b>Reason:</b> {}".format(info.fed_name, mention_html(user.id, user.first_name),
                                   mention_html(user_chat.id, user_chat.first_name),
                                                user_chat.id, reason), 
            html=True)