implement first interaction handling
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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";
|
||||
|
||||
export const dynamicVoiceChannelService = new DynamicVoiceChannelsService(
|
||||
voiceChannelsService,
|
||||
[
|
||||
{
|
||||
channelId: config.channelMapping.voice["for-two"],
|
||||
key: VoiceChannels.enum["for-two"],
|
||||
size: 2,
|
||||
},
|
||||
{
|
||||
channelId: config.channelMapping.voice["for-three"],
|
||||
key: VoiceChannels.enum["for-three"],
|
||||
size: 3,
|
||||
},
|
||||
{
|
||||
channelId: config.channelMapping.voice["for-four"],
|
||||
key: VoiceChannels.enum["for-four"],
|
||||
size: 4,
|
||||
},
|
||||
{
|
||||
channelId: config.channelMapping.voice["for-group"],
|
||||
key: VoiceChannels.enum["for-group"],
|
||||
size: 99,
|
||||
},
|
||||
],
|
||||
);
|
||||
@@ -3,7 +3,7 @@ import client from "lib/client";
|
||||
import { logger } from "lib/common-logger";
|
||||
|
||||
export class LogChannelService {
|
||||
private logChannelId = config.channelMapping.text.bot;
|
||||
private logChannelId = config.channelMapping.text.log;
|
||||
|
||||
async getLogChannel() {
|
||||
const logChannel = await client.channels.fetch(this.logChannelId);
|
||||
|
||||
@@ -2,8 +2,10 @@ import type { WaterMeService } from "@avocadi/bot-core/features/water-me/water-m
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
type ButtonInteraction,
|
||||
ButtonStyle,
|
||||
type CacheType,
|
||||
type ChatInputCommandInteraction,
|
||||
type Interaction,
|
||||
} from "discord.js";
|
||||
import { waterMeService } from "./water-me.service";
|
||||
@@ -15,7 +17,9 @@ class WaterMeController {
|
||||
this.waterMeService = waterMeService;
|
||||
}
|
||||
|
||||
async handleInteraction(interaction: Interaction<CacheType>) {
|
||||
async handleInteraction(
|
||||
interaction: ButtonInteraction | ChatInputCommandInteraction,
|
||||
) {
|
||||
const result = this.waterMeService.waterMe();
|
||||
|
||||
const moreButton = new ButtonBuilder()
|
||||
|
||||
Reference in New Issue
Block a user