def remove_url(update: Update, context: CallbackContext):
    bot = context.bot
    args = context.args
    if len(args) >= 1:
        tg_chat_id = str(update.effective_chat.id)

        tg_feed_link = args[0]

        link_processed = parse(tg_feed_link)

        if link_processed.bozo == 0:
            user_data = sql.check_url_availability(tg_chat_id, tg_feed_link)

            if user_data:
                sql.remove_url(tg_chat_id, tg_feed_link)

                update.effective_message.reply_text(
                    "Removed URL from subscription")
            else:
                update.effective_message.reply_text(
                    "You haven't subscribed to this URL yet")
        else:
            update.effective_message.reply_text(
                "This link is not an RSS Feed link")
    else:
        update.effective_message.reply_text("URL missing")
예제 #2
0
def remove_url(bot, update, args):
    if len(args) >= 1:
        tg_chat_id = str(update.effective_chat.id)

        tg_feed_link = args[0]

        link_processed = parse(tg_feed_link)

        if link_processed.bozo == 0:
            user_data = sql.check_url_availability(tg_chat_id, tg_feed_link)

            if user_data:
                sql.remove_url(tg_chat_id, tg_feed_link)

                update.effective_message.reply_text(
                    "URL abonelikten kaldırıldı")
            else:
                update.effective_message.reply_text(
                    "Bu URL'ye henüz abone olmadınız")
        else:
            update.effective_message.reply_text(
                "Bu bağlantı bir RSS Yayını bağlantısı değil")
    else:
        update.effective_message.reply_text("URL eksik")