File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { PSNoPrefixHelp } from '@/cache' ;
22import { owner , prefix , username } from '@/config/ps' ;
33import { fromHumanTime } from '@/utils/humanTime' ;
4+ import { sample } from '@/utils/random' ;
45import { toId } from '@/utils/toId' ;
56
67import type { PSMessage } from '@/types/ps' ;
@@ -31,4 +32,17 @@ export function autoResHandler(message: PSMessage) {
3132 PSNoPrefixHelp [ userid ] = new Date ( ) ;
3233 return message . reply ( helpMessage ) ;
3334 }
35+
36+ if ( message . type === 'chat' ) {
37+ if ( ! message . content . startsWith ( prefix ) ) {
38+ if ( [ 'lunarnewyear' ] . includes ( message . target . id ) ) {
39+ const HONSE_REGEX = / ( \w * ) h o r s e ( \w * ) / i;
40+ if ( HONSE_REGEX . test ( message . content ) && sample ( 20 ) === 0 ) {
41+ const honse = message . content . match ( HONSE_REGEX ) ! ;
42+ const honseText = honse [ 1 ] || honse [ 2 ] ? `*${ honse [ 1 ] } HONSE${ honse [ 2 ] } ` : '*honse' ;
43+ message . reply ( honseText ) ;
44+ }
45+ }
46+ }
47+ }
3448}
You can’t perform that action at this time.
0 commit comments