Various fixes for log_ignore
This commit is contained in:
parent
1bc99520db
commit
07f88376ae
1 changed files with 9 additions and 2 deletions
|
@ -173,7 +173,7 @@ class SettingsCog(Extension):
|
||||||
await ctx.send("Channel already ignored", ephemeral=True)
|
await ctx.send("Channel already ignored", ephemeral=True)
|
||||||
return
|
return
|
||||||
setting.value.append(channel.id)
|
setting.value.append(channel.id)
|
||||||
await setting.commit()
|
await setting.commit(replace=True)
|
||||||
await ctx.send("Channel added to ActivityLog ignore list")
|
await ctx.send("Channel added to ActivityLog ignore list")
|
||||||
|
|
||||||
# Unset
|
# Unset
|
||||||
|
@ -261,7 +261,7 @@ class SettingsCog(Extension):
|
||||||
if not setting:
|
if not setting:
|
||||||
return {}
|
return {}
|
||||||
channels = [ctx.guild.get_channel(x) for x in setting.value]
|
channels = [ctx.guild.get_channel(x) for x in setting.value]
|
||||||
channels = {c.name: c.id for c in channels}
|
channels = {c.name: c.id for c in channels if c}
|
||||||
options = process.extract(channel, list(channels.keys()), limit=25)
|
options = process.extract(channel, list(channels.keys()), limit=25)
|
||||||
await ctx.send(choices=[{"name": c[0], "value": str(channels[c[0]])} for c in options])
|
await ctx.send(choices=[{"name": c[0], "value": str(channels[c[0]])} for c in options])
|
||||||
|
|
||||||
|
@ -297,6 +297,13 @@ class SettingsCog(Extension):
|
||||||
value += "\n" + nvalue.mention
|
value += "\n" + nvalue.mention
|
||||||
else:
|
else:
|
||||||
value += "\n||`[redacted]`||"
|
value += "\n||`[redacted]`||"
|
||||||
|
elif setting.setting == "log_ignore":
|
||||||
|
names = []
|
||||||
|
for v in setting.value:
|
||||||
|
channel = ctx.guild.get_channel(v)
|
||||||
|
if channel:
|
||||||
|
names.append(channel.mention)
|
||||||
|
value = ", ".join(names) if names else "None"
|
||||||
fields.append(EmbedField(name=setting.setting, value=str(value) or "N/A", inline=False))
|
fields.append(EmbedField(name=setting.setting, value=str(value) or "N/A", inline=False))
|
||||||
|
|
||||||
embed = build_embed(title="Current Settings", description="", fields=fields)
|
embed = build_embed(title="Current Settings", description="", fields=fields)
|
||||||
|
|
Loading…
Add table
Reference in a new issue