add greeting

add locales
This commit is contained in:
mo
2026-02-22 00:09:27 +01:00
parent 453577f1b2
commit bc0a6f2526
25 changed files with 183 additions and 449 deletions

View File

@@ -1,6 +1,6 @@
import { config } from "config";
import { Routes } from "discord.js";
import getCommands from "entitites/commands";
import getCommands from "entities/commands";
import { logger } from "lib/common-logger";
import { discordRestClient } from "lib/rest-client";

View File

@@ -1,7 +1,7 @@
import { VoiceChannels } from "@avocadi/bot-core/entities/channels/channels.schema";
import { DynamicVoiceChannelsService } from "@avocadi/bot-core/features/dynamic-voice-channels/dynamic-voice-channels.service";
import { config } from "config";
import { voiceChannelsService } from "entitites/channels/voice/voice-channels.service";
import { voiceChannelsService } from "entities/channels/voice/voice-channels.service";
export const dynamicVoiceChannelService = new DynamicVoiceChannelsService(
voiceChannelsService,

View File

@@ -0,0 +1,9 @@
import { GreetingService } from "@avocadi/bot-core/features/greeting/greeting.service";
import { i18nService } from "@avocadi/bot-core/lib/i18n";
import { messagesService } from "entities/messages/messages.service";
export const greetingService = new GreetingService(
messagesService,
i18nService,
"de",
);

View File

@@ -1,4 +0,0 @@
import { GreetingService } from "@avocadi/bot-core/features/greeting/greeting.service";
import { messagesService } from "entitites/messages/messages.service";
export const greetingsService = new GreetingService(messagesService);

View File

@@ -1,6 +1,6 @@
import { WaterMeService } from "@avocadi/bot-core/features/water-me/water-me.service";
import { i18nService } from "@avocadi/bot-core/lib/i18n";
import { messagesService } from "entitites/messages/messages.service";
import { messagesService } from "entities/messages/messages.service";
export const waterMeService = new WaterMeService(
messagesService,

View File

@@ -1,4 +1,4 @@
import { greetingsService } from "features/greeting/greetings.service";
import { greetingService } from "features/greeting/greeting.service";
import { logChannelService } from "features/log-channel/log-channel.service";
import client from "lib/client";
@@ -9,7 +9,7 @@ client.on("guildMemberAdd", async (member) => {
return;
}
greetingsService.sendGreeting(member.user, member.user.username);
greetingService.sendGreeting(member.user, member.user.username);
logChannelService.sendLogMessage(
`Neues Mitglied: <@${member.user.id}> (${member.user.tag}) ist dem Server beigetreten.`,
);

View File

@@ -1,5 +1,5 @@
import { config } from "config";
import { messagesService } from "entitites/messages/messages.service";
import { messagesService } from "entities/messages/messages.service";
import client from "lib/client";
client.on("messageCreate", async (message) => {

View File

@@ -1,5 +1,5 @@
import type { VoiceState } from "discord.js";
import { voiceChannelsService } from "entitites/channels/voice/voice-channels.service";
import { voiceChannelsService } from "entities/channels/voice/voice-channels.service";
import { dynamicVoiceChannelService } from "features/dynamic-voice-channel/dynamic-voice-channel.service";
export const handleDynamicVoiceChannelDeletion = async (

View File

@@ -0,0 +1,9 @@
import { GreetingService } from "@avocadi/bot-core/features/greeting/greeting.service";
import { i18nService } from "@avocadi/bot-core/lib/i18n";
import { messagesService } from "entities/messages/messages.service";
export const greetingService = new GreetingService(
messagesService,
i18nService,
"en",
);

View File

@@ -0,0 +1,25 @@
import { Events, type GuildMember } from "@fluxerjs/core";
import { config } from "config";
import { greetingService } from "features/greeting/greeting.service";
import { logChannelService } from "features/log-channel/log-channel.service";
import client from "lib/client";
import { logger } from "lib/common-logger";
client.on(Events.GuildMemberAdd, async (member: GuildMember) => {
logger.info(`${member.user.username} joined the server}`);
if (member.user.bot) {
// Don't send a welcome message for bots (sorry tom)
return;
}
const channel = await client.channels.fetch(config.channelMapping.text.log);
await greetingService.sendGreeting(member.user.username, channel);
await logChannelService.sendLogMessage(
`new member: <@${member.user.id}> (${member.user.username}) joined the server.`,
);
await greetingService.sendDmGreeting(member.user, member.user.username);
await logChannelService.sendLogMessage(
`new member: <@${member.user.id}> (${member.user.username}) joined the server.`,
);
});

View File

@@ -1,3 +1,4 @@
import "./ready.listener";
import "./stop.listener";
import "./messages/messages.listener";
import "./guild-members/guild-members.listener";

View File

@@ -7,12 +7,13 @@ import { logger } from "lib/common-logger";
import { handleCommand } from "./handle-command";
client.on(Events.MessageCreate, async (message: Message) => {
if (
message.channel?.id !== config.channelMapping.text.log &&
message.channel?.id !== config.channelMapping.text.bot
) {
await messagesService.logMessage(message);
}
// if (
// message.channel?.id !== config.channelMapping.text.log &&
// message.channel?.id !== config.channelMapping.text.bot
// ) {
// return;
// // await messagesService.logMessage(message);
// }
if (message.content?.startsWith(config.commandPrefix) && message.channel) {
await messagesService.logMessage(message);