File tree 2 files changed +20
-3
lines changed
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -727,6 +727,13 @@ async def _map(ctx: Context) -> Optional[str]:
727
727
# and are generally for managing players.
728
728
"""
729
729
730
+ ACTION_STRINGS = {
731
+ "restrict" : "Restricted for" ,
732
+ "unrestrict" : "Unrestricted for" ,
733
+ "silence" : "Silenced for" ,
734
+ "unsilence" : "Unsilenced for" ,
735
+ "note" : "Note added:"
736
+ }
730
737
731
738
@command (Privileges .MODERATOR , hidden = True )
732
739
async def notes (ctx : Context ) -> Optional [str ]:
@@ -755,7 +762,17 @@ async def notes(ctx: Context) -> Optional[str]:
755
762
if not res :
756
763
return f"No notes found on { t } in the past { days } days."
757
764
758
- return "\n " .join (["[{time}] {action} for {reason}" .format (** row , reason = row ["msg" ] or "no reason specified" ) for row in res ])
765
+ return "\n " .join (
766
+ ["[{time}] {action_str} {note} by {logger}" .format (
767
+ ** row ,
768
+ logger = repr (
769
+ await app .state .sessions .players .from_cache_or_sql (id = row ["logger" ])
770
+ ),
771
+ action_str = ACTION_STRINGS [row ["action" ]],
772
+ note = row ["msg" ] or "not specified"
773
+ )
774
+ for row in res ]
775
+ )
759
776
760
777
761
778
@command (Privileges .MODERATOR , hidden = True )
Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ create table logs
99
99
primary key ,
100
100
` from` int not null comment ' both from and to are playerids' ,
101
101
` to` int not null ,
102
- ` action` varchar (32 ) null ,
103
- msg varchar (2048 ) charset utf8 not null ,
102
+ ` action` varchar (32 ) not null ,
103
+ msg varchar (2048 ) charset utf8 null ,
104
104
time datetime not null on update CURRENT_TIMESTAMP
105
105
);
106
106
You can’t perform that action at this time.
0 commit comments