Fix for the spammyness of !alts add <list>

Added the old broadcast module back
fix for !wants list
This commit is contained in:
2021-10-22 19:44:26 +02:00
parent bb445e868d
commit bd8055dac7
6 changed files with 120 additions and 29 deletions
+5 -5
View File
@@ -88,17 +88,17 @@ class WantsController:
main_name = alts[0].name
blob += f"<header2>{main_name}</header2>\n{want.want}\n\n"
return ChatBlob("Search Results (%d)" % len(wants), blob)
return ChatBlob(f"Search Results ({len(wants)})", blob)
@command(command="wants", params=[Const("list")], access_level="member",
description="Shows all wants")
def wants_all_cmd(self, request, _):
sql = "SELECT w.*, p.name FROM wants w \
LEFT JOIN alts a ON w.char_id = a.char_id \
LEFT JOIN alts a2 ON (a2.group_id = a.group_id AND a2.status = 2) \
LEFT JOIN account a ON w.char_id = a.char_id \
LEFT JOIN account a2 ON (a2.main = a.main) \
LEFT JOIN player p ON p.char_id = COALESCE(a2.char_id, w.char_id) \
ORDER BY p.name"
data = self.db.query(sql)
blob = ""
@@ -110,4 +110,4 @@ class WantsController:
blob += want.want + "\n"
return ChatBlob(f"Wants List ({len(data):d})", blob)
return ChatBlob(f"Wants List ({len(data)})", blob)