Changed the string formatter from % to f"",

Fixed a bug related to logging [log dir does not exist on master, and needs to get created on first startup]
Added !prefadmin <user> to view preferences of players, and change them
Orgrank & name will be hidden in !alts, if the character is not in an org
Page prefix & suffix are now being relayed [for example, it affects !online
Fixed !perks
Added comments regarding external API's.
This commit is contained in:
2021-08-14 02:36:20 +02:00
parent 80b5a4b577
commit 46d0ba3634
19 changed files with 104 additions and 86 deletions
+3 -3
View File
@@ -22,12 +22,12 @@ class Logger:
def log_chat(self, conn_id, channel, sender, msg):
if sender:
self.info("(%s) [%s] %s: %s" % (conn_id, channel, sender, self.format_chat_message(msg)))
self.info(f"({conn_id}) [{channel}] {sender}: {self.format_chat_message(msg)}")
else:
self.info("(%s) [%s] %s" % (conn_id, channel, self.format_chat_message(msg)))
self.info(f"({conn_id}) [{channel}] {self.format_chat_message(msg)}")
def log_tell(self, conn_id, direction, sender, msg):
self.info("(%s) %s %s: %s" % (conn_id, direction.capitalize(), sender, self.format_chat_message(msg)))
self.info(f"({conn_id}) {direction.capitalize()} {sender}: {self.format_chat_message(msg)}")
def format_chat_message(self, msg):
msg = re.sub(r"<a\s+href=\".+?[^\\]\">", "[link]", msg, flags=re.UNICODE | re.DOTALL)