Skip to content

Commit 5dc36ee

Browse files
committed
fix: discord sendmessage
1 parent 291d569 commit 5dc36ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/velog-server/src/lib/discord/DiscordService.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Time } from '@constants/TimeConstants.js'
99
export class DiscordService {
1010
private client!: Client
1111
public isSending: boolean = false
12-
construct() {}
1312
public connection(): Promise<Client> {
1413
return new Promise((resolve) => {
1514
this.client = new Client({
@@ -27,7 +26,7 @@ export class DiscordService {
2726
public async sendMessage(type: MessageType, payload: MessagePayload | string) {
2827
this.isSending = true
2928

30-
let message = ''
29+
let message: string = ''
3130
if (typeof payload === 'string') {
3231
message = payload
3332
} else {
@@ -57,7 +56,7 @@ export class DiscordService {
5756
return
5857
}
5958

60-
if (typeof payload === 'object' && payload.body?.include('WritePost') && payload?.user?.id) {
59+
if (typeof payload === 'object' && message.includes('WritePost') && payload?.user?.id) {
6160
const redisService = container.resolve(RedisService)
6261
const key = redisService.generateKey.errorMessageCache(payload.type, payload?.user?.id)
6362
const exists = await redisService.exists(key)

0 commit comments

Comments
 (0)