1
0
mirror of https://github.com/osmarks/autobotrobot synced 2025-07-04 02:53:07 +00:00

give name of role mentions

This commit is contained in:
what 2021-10-06 06:58:04 -07:00 committed by GitHub
parent 40b82bd10b
commit 0bf84250b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,8 @@ def render_formatting(message):
out += f"@{random_color(seg['id'])}{seg['name']}{color_code('')}" out += f"@{random_color(seg['id'])}{seg['name']}{color_code('')}"
elif kind == "channel_mention": # these appear to be clickable across servers/guilds elif kind == "channel_mention": # these appear to be clickable across servers/guilds
out += f"#{seg['name']}" out += f"#{seg['name']}"
elif kind == "role_mention":
out += f"@{random_color(seg['id'])}{seg['name']}{color_code('')}"
else: logging.warn("Unrecognized message seg %s", kind) else: logging.warn("Unrecognized message seg %s", kind)
return out.strip() return out.strip()