# Path: botlistbot/util.py
# def stop_banned(update, user):
# def track_groups(func):
#     def wrapped(bot, update, *args, **kwargs):
# def restricted(func=None, strict=False, silent=False):
#     def wrapped(bot, update, *args, **kwargs):
# def private_chat_only(func):
#     def wrapped(bot, update, *args, **kwargs):
# def timeit(method):
#     def timed(*args, **kw):
# def build_menu(buttons: List,
#                n_cols,
#                header_buttons: List = None,
#                footer_buttons: List = None):
# def cid_from_update(update):
# def uid_from_update(update):
# def encode_base64(query):
# def callback_for_action(action, params=None):
# def callback_data_from_update(update):
# def is_group_message(update):
# def is_private_message(update):
# def original_reply_id(update):
# def is_inline_message(update):
# def message_text_from_update(update):
# def mid_from_update(update):
# def escape_markdown(text):
# def callback_str_from_dict(d):
# def wait(bot, update, t=1.5):
# def order_dict_lexi(d):
# def private_or_else_group_message(bot, chat_id, text):
# def send_or_edit_md_message(bot, chat_id, text, to_edit=None, **kwargs):
# def send_md_message(bot, chat_id, text: str, **kwargs):
# def send_message_success(bot, chat_id, text: str, add_punctuation=True, reply_markup=None, **kwargs):
# def send_message_failure(bot, chat_id, text: str, **kwargs):
# def send_action_hint(bot, chat_id, text: str, **kwargs):
# def success(text):
# def failure(text):
# def action_hint(text):


from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import ConversationHandler
from botlistbot import util
from botlistbot.const import CallbackActions



def manage_subscription(bot, update):
    chat_id = update.effective_chat.id
    user_id = update.effective_user.id

    if util.is_group_message(update):
        admins = bot.get_chat_administrators(chat_id)
        if user_id not in admins:
            bot.formatter.send_failure(chat_id, "Sorry, but only Administrators of this group are allowed "
                                                    "to manage subscriptions.")
            return

    text = "Would you like to be notified when new bots arrive at the @BotList?"
    buttons = [[

# Path: botlistbot/util.py
# def stop_banned(update, user):
# def track_groups(func):
#     def wrapped(bot, update, *args, **kwargs):
# def restricted(func=None, strict=False, silent=False):
#     def wrapped(bot, update, *args, **kwargs):
# def private_chat_only(func):
#     def wrapped(bot, update, *args, **kwargs):
# def timeit(method):
#     def timed(*args, **kw):
# def build_menu(buttons: List,
#                n_cols,
#                header_buttons: List = None,
#                footer_buttons: List = None):
# def cid_from_update(update):
# def uid_from_update(update):
# def encode_base64(query):
# def callback_for_action(action, params=None):
# def callback_data_from_update(update):
# def is_group_message(update):
# def is_private_message(update):
# def original_reply_id(update):
# def is_inline_message(update):
# def message_text_from_update(update):
# def mid_from_update(update):
# def escape_markdown(text):
# def callback_str_from_dict(d):
# def wait(bot, update, t=1.5):
# def order_dict_lexi(d):
# def private_or_else_group_message(bot, chat_id, text):
# def send_or_edit_md_message(bot, chat_id, text, to_edit=None, **kwargs):
# def send_md_message(bot, chat_id, text: str, **kwargs):
# def send_message_success(bot, chat_id, text: str, add_punctuation=True, reply_markup=None, **kwargs):
# def send_message_failure(bot, chat_id, text: str, **kwargs):
# def send_action_hint(bot, chat_id, text: str, **kwargs):
# def success(text):
# def failure(text):
# def action_hint(text):


# Path: botlistbot/misc.py
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import ConversationHandler
from botlistbot import util
from botlistbot.const import CallbackActions




def manage_subscription(bot, update):
    chat_id = update.effective_chat.id
    user_id = update.effective_user.id

    if util.is_group_message(update):
        admins = bot.get_chat_administrators(chat_id)
        if user_id not in admins:
            bot.formatter.send_failure(chat_id, "Sorry, but only Administrators of this group are allowed "
                                                    "to manage subscriptions.")
            return

    text = "Would you like to be notified when new bots arrive at the @BotList?"
    buttons = [[

        InlineKeyboardButton(util.success("Yes"),