This commit is contained in:
moriese 2025-01-06 15:17:51 +01:00
parent 94d2fc40e6
commit 78a65511c2
4 changed files with 17 additions and 1 deletions

3
.gitignore vendored
View File

@ -173,3 +173,6 @@ dist
# Finder (MacOS) folder config
.DS_Store
# DB
avocadis_diary.sqlite

Binary file not shown.

View File

@ -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) {

View File

@ -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 || "",