blacklist.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
def complete_config(message: discord.Message):
    """ Return the correct config info using the given message object. 

    :param message: discord.Message to determine complete config data.
    :return: BlacklistConfig
    """
    if message.channel.id in blacklist_cache:
        return blacklist_cache[message.channel.id]

    # Start with global, overwrite with server, overwrite with channel
    data = {}
    update_data(data, "global")
    update_data(data, "server", message.server.id)
    update_data(data, "channel", message.channel.id)
    valid_config = make_config_object(data)

    # Add the found config to the channel cache, considering this will always be the channel override
    blacklist_cache[message.channel.id] = valid_config

    return valid_config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号