fix: It's dokdo command, but if use the message components, show forbidden by deleteLearnedData
This commit is contained in:
parent
4200f2a151
commit
528d7f09eb
3 changed files with 12 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Config } from './config'
|
||||
import { ReleaseChannel } from './lib/releaseChannel'
|
||||
import { container } from '@sapphire/pieces'
|
||||
import type { Client } from 'dokdo'
|
||||
import { connect, disconnect } from 'mongoose'
|
||||
|
||||
declare module '@sapphire/pieces' {
|
||||
|
@ -15,9 +16,9 @@ declare module '@sapphire/pieces' {
|
|||
success: number
|
||||
}
|
||||
channel: ReleaseChannel
|
||||
}
|
||||
dokdo: Client
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@sapphire/framework' {
|
||||
interface DetailedDescriptionCommandObject {
|
||||
|
@ -29,7 +30,7 @@ declare module '@sapphire/framework' {
|
|||
container.dbDisconnect = async () => await disconnect()
|
||||
container.config = new Config()
|
||||
container.prefix = container.config.bot.prefix
|
||||
container.version = '5.0.0-yogurt_canary.250308b'
|
||||
container.version = '5.0.0-yogurt_canary.250309a'
|
||||
container.embedColors = {
|
||||
default: 0xaddb87,
|
||||
fail: 0xff0000,
|
||||
|
|
|
@ -19,6 +19,14 @@ export default class DeleteLearnedDataHandler extends InteractionHandler {
|
|||
public async parse(
|
||||
interaction: StringSelectMenuInteraction | ButtonInteraction,
|
||||
) {
|
||||
if (
|
||||
!interaction.customId.startsWith(
|
||||
MuffinCustomId.DeleteLearnedDataCancel,
|
||||
) ||
|
||||
!interaction.customId.startsWith(MuffinCustomId.DeleteLearnedDataUserId)
|
||||
)
|
||||
return this.none()
|
||||
|
||||
const userId = interaction.isButton()
|
||||
? interaction.customId.slice(
|
||||
MuffinCustomId.DeleteLearnedDataCancel.length,
|
||||
|
|
|
@ -13,6 +13,7 @@ export default class ClientReadyListener extends Listener {
|
|||
owners: [this.container.config.bot.ownerId],
|
||||
secrets: [this.container.config.databaseUrl],
|
||||
aliases: ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트'],
|
||||
globalVariable: { container: this.container },
|
||||
noPerm: async msg =>
|
||||
await msg.reply({
|
||||
content: '당신은 내 제작자가 아니잖아!',
|
||||
|
|
Reference in a new issue