fix for !track & !mrelay abbrv
This commit is contained in:
@@ -207,6 +207,23 @@ class AllianceRelay:
|
||||
return f"Successfully changed the symbol for relaying messages to " \
|
||||
f"<highlight>{self.character_service.get_char_name(int(bot))}</highlight>: <highlight>{prefix}</highlight>"
|
||||
|
||||
@command(command="mrelay",
|
||||
params=[Const("abbrv"), Character("relaybot_name"), Any("Abbreviation")],
|
||||
access_level="admin",
|
||||
description="Change the abbreviation setting of the relays")
|
||||
def mrelay_abbrv(self, request, _, bot, abbreviation):
|
||||
bots: dict = self.relay_bots().get_value()
|
||||
if not bot.char_id:
|
||||
return f"The character <highlight>{bot.name}</highlight> does not exist."
|
||||
if str(bot.char_id) not in bots.keys():
|
||||
return f"There's no relay for <highlight>{bot.name}</highlight> registered. Please use <symbol>mrelay create {bot.name}"
|
||||
bot = str(bot.char_id)
|
||||
current = self.relay_guild_abbreviations().get_value()
|
||||
current[bot] = abbreviation
|
||||
self.relay_guild_abbreviations().set_value(current)
|
||||
return f"Successfully changed the Abbreviation for relaying messages to " \
|
||||
f"<highlight>{self.character_service.get_char_name(int(bot))}</highlight>: <highlight>{abbreviation}</highlight>"
|
||||
|
||||
@command(command="mrelay",
|
||||
params=[Const("status"), Character("relaybot_name"), Options(["on", "off", "true", "false"])],
|
||||
access_level="admin",
|
||||
|
||||
Reference in New Issue
Block a user