Merge pull request #77 from noirscape/roles-accessed-too-early
Fix a variable 'roles' referenced before assignment error when relying on default fallback.
This commit is contained in:
commit
586c6239b2
1 changed files with 2 additions and 0 deletions
|
@ -37,6 +37,7 @@ class Lockdown(Cog):
|
||||||
channel = ctx.channel
|
channel = ctx.channel
|
||||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||||
|
|
||||||
|
roles = None
|
||||||
for key, lockdown_conf in config.lockdown_configs.items():
|
for key, lockdown_conf in config.lockdown_configs.items():
|
||||||
if channel.id in lockdown_conf["channels"]:
|
if channel.id in lockdown_conf["channels"]:
|
||||||
roles = lockdown_conf["roles"]
|
roles = lockdown_conf["roles"]
|
||||||
|
@ -76,6 +77,7 @@ class Lockdown(Cog):
|
||||||
channel = ctx.channel
|
channel = ctx.channel
|
||||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||||
|
|
||||||
|
roles = None
|
||||||
for key, lockdown_conf in config.lockdown_configs.items():
|
for key, lockdown_conf in config.lockdown_configs.items():
|
||||||
if channel.id in lockdown_conf["channels"]:
|
if channel.id in lockdown_conf["channels"]:
|
||||||
roles = lockdown_conf["roles"]
|
roles = lockdown_conf["roles"]
|
||||||
|
|
Loading…
Reference in a new issue