@@ -152,6 +152,12 @@ export default async function (msg: Message, type: string): Promise<void> {
152152 await sleep ( randomMs ) ;
153153 const isEmoji = / .* [ A - Z a - z 0 - 9 ] .* / . test ( reaction ) ;
154154 log . info ( "AutoReact" , lid , reaction ) ;
155+ await redis . set ( `react:${ msg . id . id } ` , "1" , {
156+ expiration : {
157+ type : "EX" ,
158+ value : 3600 , // 1 hour
159+ } ,
160+ } ) ;
155161
156162 if ( Math . random ( ) < 0.1 && ! isEmoji )
157163 if ( Math . random ( ) < 0.2 )
@@ -215,12 +221,12 @@ export default async function (msg: Message, type: string): Promise<void> {
215221
216222 if (
217223 ( handler . role === "super-admin" && ! msg . fromMe ) ||
218- ( handler . role === "admin" && ! isUserAdmin )
224+ ( handler . role === "admin" && ! ( isUserAdmin || msg . fromMe ) )
219225 ) {
220226 return ;
221227 }
222228
223- log . info ( "Message" , lid , msg . body . slice ( 0 , 150 ) ) ;
229+ log . info ( "Message" , lid , key ) ;
224230 msg . body = newMessageBody ;
225231
226232 /*
@@ -237,7 +243,7 @@ export default async function (msg: Message, type: string): Promise<void> {
237243 options ?: MessageSendOptions ,
238244 ) : Promise < Message > => {
239245 let messageBody = typeof content === "string" ? Font ( content ) : content ;
240- log . info ( "ReplyMessage " , lid , content . toString ( ) . slice ( 0 , 150 ) ) ;
246+ log . info ( "Reply " , lid , key ) ;
241247
242248 if ( ! msg . fromMe ) {
243249 const chat = await msg . getChat ( ) ;
0 commit comments