Moved the coloring from <color>[text]<end> to <color>[test]</color>, which allows the discord module to reparse the messages more accurately
This commit is contained in:
@@ -41,19 +41,19 @@ class BotController(BaseModule):
|
||||
def cmd_orgs_bots_add(self, request, _, _1, bot):
|
||||
player = self.pork.request_char_info(bot.name, 5)
|
||||
if self.db.exec("INSERT IGNORE INTO org_bots(char_id, org_id) VALUES(?, ?)", [bot.char_id, player.org_id]) == 0:
|
||||
request.reply(f"The bot <highlight>{bot.name}<end> is already marked as a chatbot.")
|
||||
request.reply(f"The bot <highlight>{bot.name}</highlight> is already marked as a chatbot.")
|
||||
else:
|
||||
self.db.exec("DELETE FROM online where char_id=?", [bot.char_id])
|
||||
request.reply(f"Successfully marked <highlight>{bot.name}<end> as a chatbot.")
|
||||
request.reply(f"Successfully marked <highlight>{bot.name}</highlight> as a chatbot.")
|
||||
|
||||
@command(command="orgs", params=[Const("bots"), Const("rem"), Character("botname")], access_level="admin",
|
||||
description="Add an bot to the bot list", sub_command="bots_mng")
|
||||
def cmd_orgs_bots_rem(self, request, _, _1, bot):
|
||||
|
||||
if self.db.exec("DELETE FROM org_bots WHERE char_id=?", [bot.char_id]) == 0:
|
||||
request.reply(f"<highlight>{bot.name}<end> is not a chatbot.")
|
||||
request.reply(f"<highlight>{bot.name}</highlight> is not a chatbot.")
|
||||
else:
|
||||
request.reply(f"Successfully removed <highlight>{bot.name}<end> as a chatbot. The character will show up in !online again after its next login.")
|
||||
request.reply(f"Successfully removed <highlight>{bot.name}</highlight> as a chatbot. The character will show up in !online again after its next login.")
|
||||
|
||||
@command(command="orgs",
|
||||
params=[Const("bots")],
|
||||
@@ -63,8 +63,8 @@ class BotController(BaseModule):
|
||||
def cmd_orgs_bots_show(self, _, _1):
|
||||
def format_row(query):
|
||||
bud = self.buddy_service.is_online(query["char_id"])
|
||||
buddy = "<green>O<end>" if bud == 1 else "<red>O<end>" if bud == 0 else "<grey>U<end>"
|
||||
return "- [{status}] <highlight>{name}<end> (<notice>{org_name}<end>)\n".format(**query, status=buddy)
|
||||
buddy = "<green>O</green>" if bud == 1 else "<red>O</red>" if bud == 0 else "<grey>U</grey>"
|
||||
return "- [{status}] <highlight>{name}</highlight> (<notice>{org_name}</notice>)\n".format(**query, status=buddy)
|
||||
|
||||
data = self.db.query("SELECT * FROM org_bots o LEFT JOIN player p on o.char_id = p.char_id order by p.org_name")
|
||||
blob = ""
|
||||
|
||||
Reference in New Issue
Block a user