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
评论列表
文章目录