bot.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:YeeBot 作者: jaspric 项目源码 文件源码
def review(ctx, amount=1, member: discord.Member = None):
    if member is None:
        member = ctx.message.author
    if ctx.message.channel.id == review_channel_id:
        if amount < 1 or amount > 5:
            return await yeebot.say("Please use the format `!review <1-5>`.")
        elif amount > 1 and amount < 6:
            cur.execute("SELECT link, submitter_name FROM links WHERE status = 'review' LIMIT ?", (amount, ))
            links = cur.fetchall()
            if links:
                for row in links:
                    await yeebot.say("Submitted by: {}, `{}`".format(row[1], row[0]))
            else:
                return await yeebot.say("No links to review.")
        else:
            cur.execute("SELECT link, submitter_name FROM links WHERE status = 'review' LIMIT ?", (amount, ))
            links = cur.fetchall()
            if links:
                for row in links:
                    await yeebot.say("Submitted by: {}, {}".format(row[1], row[0]))
            else:
                return await yeebot.say("No links to review.")
    else:
        return await yeebot.say("You do not have permission to execute this command.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号