basic.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
def mark(message: discord.Message, plugin: plugin_in_req, req_id: get_req_id):
    """ Toggles marking a feature request as complete.
    See `{pre}plugin` for a list of plugins. """
    # Test and reply if feature by requested id doesn't exist
    assert feature_exists(plugin, req_id), "There is no such feature."

    req = feature_reqs.data[plugin][req_id]

    # Mark or unmark the feature request by adding or removing +++ from the end (slightly hacked)
    if not req.endswith("+++"):
        feature_reqs.data[plugin][req_id] += "+++"
        feature_reqs.save()
        await client.say(message, "Marked feature with `{}` id **#{}**.".format(plugin, req_id + 1))
    else:
        feature_reqs.data[plugin][req_id] = req[:-3]
        feature_reqs.save()
        await client.say(message, "Unmarked feature with `{}` id **#{}**.".format(plugin, req_id + 1))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号