Fix settings list with rolegiver
This commit is contained in:
parent
b034f07b07
commit
148818efc3
2 changed files with 12 additions and 2 deletions
|
@ -50,7 +50,9 @@ class JokeCog(commands.Cog):
|
||||||
return
|
return
|
||||||
emotes = re.findall(r"(&#x[a-fA-F0-9]*;)", result["body"])
|
emotes = re.findall(r"(&#x[a-fA-F0-9]*;)", result["body"])
|
||||||
for match in emotes:
|
for match in emotes:
|
||||||
result["body"] = result["body"].replace(match, html.unescape(match))
|
result["body"] = result["body"].replace(
|
||||||
|
match, html.unescape(match)
|
||||||
|
)
|
||||||
emotes = re.findall(r"(&#x[a-fA-F0-9]*;)", result["title"])
|
emotes = re.findall(r"(&#x[a-fA-F0-9]*;)", result["title"])
|
||||||
for match in emotes:
|
for match in emotes:
|
||||||
result["title"] = result["title"].replace(
|
result["title"] = result["title"].replace(
|
||||||
|
|
|
@ -250,7 +250,15 @@ class SettingsCog(commands.Cog):
|
||||||
value = value.mention
|
value = value.mention
|
||||||
else:
|
else:
|
||||||
value = "||`[redacted]`||"
|
value = "||`[redacted]`||"
|
||||||
fields.append(Field(name=setting.setting, value=value))
|
elif setting.setting == "rolegiver":
|
||||||
|
value = ""
|
||||||
|
for role in setting.value:
|
||||||
|
nvalue = find(lambda x: x.id == value, ctx.guild.roles)
|
||||||
|
if value:
|
||||||
|
value += "\n" + nvalue.mention
|
||||||
|
else:
|
||||||
|
value += "\n||`[redacted]`||"
|
||||||
|
fields.append(Field(name=setting.setting, value=value or "N/A"))
|
||||||
|
|
||||||
embed = build_embed(
|
embed = build_embed(
|
||||||
title="Current Settings", description="", fields=fields
|
title="Current Settings", description="", fields=fields
|
||||||
|
|
Loading…
Add table
Reference in a new issue