add greeting
add locales
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
);
|
||||
@@ -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);
|
||||
@@ -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,
|
||||
|
||||
@@ -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.`,
|
||||
);
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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",
|
||||
);
|
||||
@@ -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.`,
|
||||
);
|
||||
});
|
||||
@@ -1,3 +1,4 @@
|
||||
import "./ready.listener";
|
||||
import "./stop.listener";
|
||||
import "./messages/messages.listener";
|
||||
import "./guild-members/guild-members.listener";
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user