init
This commit is contained in:
54
modals/reakcnerole.js
Normal file
54
modals/reakcnerole.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import { ApplicationCommandOptionTypes, ApplicationCommandTypes, ButtonStyles, ComponentTypes, MessageFlags, Permissions, SeparatorSpacingSize } from "oceanic.js";
|
||||
|
||||
export default {
|
||||
data: {
|
||||
name: "reakcnerole",
|
||||
},
|
||||
|
||||
handle: async (interaction, database) => {
|
||||
await interaction.defer(MessageFlags.EPHEMERAL)
|
||||
|
||||
const db = database.table(`rr`)
|
||||
|
||||
const splitID = interaction.data.customID.split('.')
|
||||
|
||||
const kolekcia = splitID[1]
|
||||
|
||||
const exists = await db.has(`${interaction.guildID}.${kolekcia}`)
|
||||
|
||||
if (!exists)
|
||||
return await interaction.createFollowup({
|
||||
flags: MessageFlags.IS_COMPONENTS_V2,
|
||||
components: [
|
||||
{
|
||||
type: ComponentTypes.CONTAINER,
|
||||
components: [
|
||||
{
|
||||
type: ComponentTypes.TEXT_DISPLAY,
|
||||
content: `❌ kolekcia ${kolekcia} neexistuje`
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const popis = interaction.data.components.getTextInput(`popis`)
|
||||
|
||||
await db.set(`${interaction.guildID}.${kolekcia}.popis`, popis)
|
||||
|
||||
await interaction.createFollowup({
|
||||
flags: MessageFlags.IS_COMPONENTS_V2,
|
||||
components: [
|
||||
{
|
||||
type: ComponentTypes.CONTAINER,
|
||||
components: [
|
||||
{
|
||||
type: ComponentTypes.TEXT_DISPLAY,
|
||||
content: `✅ popis kolekcie ${kolekcia} zmeneny`
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user