Beispiel #1
0
def changelog(bot: Bot, update: Update, args: List[str]):
    msg = update.effective_message
    if (len(args) != 1):
        msg.reply_text("Invalid repo name")
        return
    url = getRepo(bot, update, args[0])
    if not api.getData(url):
        msg.reply_text("Invalid <user>/<repo> combo")
        return
    data = api.getData(url)
    release = api.getLastestReleaseData(data)
    body = api.getBody(release)
    msg.reply_text(body)
    return
Beispiel #2
0
def changelog(update, context):
    args = context.args
    msg = update.effective_message
    if(len(args) != 1):
        msg.reply_text("Invalid repo name")
        return
    url, index = getRepo(context.bot, update, args[0])
    if url is None and index is None:
        msg.reply_text("There was a problem parsing your request. Likely this is not a saved repo shortcut", parse_mode=ParseMode.HTML, disable_web_page_preview=True)
        return
    if not api.getData(url):
        msg.reply_text("Invalid <user>/<repo> combo")
        return
    data = api.getData(url)
    release = api.getReleaseData(data, index)
    body = api.getBody(release)
    msg.reply_text(body)
    return