File tree 1 file changed +2
-3
lines changed
packages/velog-server/src/lib/discord
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { Time } from '@constants/TimeConstants.js'
9
9
export class DiscordService {
10
10
private client ! : Client
11
11
public isSending : boolean = false
12
- construct ( ) { }
13
12
public connection ( ) : Promise < Client > {
14
13
return new Promise ( ( resolve ) => {
15
14
this . client = new Client ( {
@@ -27,7 +26,7 @@ export class DiscordService {
27
26
public async sendMessage ( type : MessageType , payload : MessagePayload | string ) {
28
27
this . isSending = true
29
28
30
- let message = ''
29
+ let message : string = ''
31
30
if ( typeof payload === 'string' ) {
32
31
message = payload
33
32
} else {
@@ -57,7 +56,7 @@ export class DiscordService {
57
56
return
58
57
}
59
58
60
- if ( typeof payload === 'object' && payload . body ?. include ( 'WritePost' ) && payload ?. user ?. id ) {
59
+ if ( typeof payload === 'object' && message . includes ( 'WritePost' ) && payload ?. user ?. id ) {
61
60
const redisService = container . resolve ( RedisService )
62
61
const key = redisService . generateKey . errorMessageCache ( payload . type , payload ?. user ?. id )
63
62
const exists = await redisService . exists ( key )
You can’t perform that action at this time.
0 commit comments