diff --git a/.gitignore b/.gitignore index 9b1ee42..e1cf1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,6 @@ dist # Finder (MacOS) folder config .DS_Store + +# DB +avocadis_diary.sqlite diff --git a/mydb.sqlite b/mydb.sqlite index 4e43f46..e69de29 100644 Binary files a/mydb.sqlite and b/mydb.sqlite differ diff --git a/src/actions/dm/dm.service.ts b/src/actions/dm/dm.service.ts index d18a2ae..b5b0424 100644 --- a/src/actions/dm/dm.service.ts +++ b/src/actions/dm/dm.service.ts @@ -41,7 +41,19 @@ export class DmService { const context = `<@${message.author.id}> hat geschrieben: " ${message.content} "`; console.log(context); - client.users.send(config.discord.myId, context); + + try { + const channels = client.channels; + const channel = channels.cache.get(config.discord.channelIdNotification); + + if (channel?.isTextBased() && channel?.isSendable()) { + await channel.send(context); + } + } catch (error) { + console.error("error while forwarding a welcome msg:", error); + } + + //client.users.send(config.discord.myId, context); } async acceptDm(member: GuildMember) { diff --git a/src/config.ts b/src/config.ts index 9cc42a0..0c3619c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -6,6 +6,7 @@ export default { // avocadi serverID: process.env.DISCORD_SERVER_ID || "", + channelIdNotification: process.env.DISCORD_CHANNEL_ID_NOTIFICATION || "", channelIdNews: process.env.DISCORD_CHANNEL_ID_NEWS || "", channelIdFeedback: process.env.DISCORD_CHANNEL_ID_FEEDBACK || "", channelIdIntroduction: process.env.DISCORD_CHANNEL_ID_INTRODUCTION || "",