Kiwi
Kiwi
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/29/2024 in #djs-questions
Getting message context after modal submission best practice
Ooooh I'll give that a shot, thanks!
4 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
It worked
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
Thank you!!
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
I see now you just register it like a regular slash command
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
Ohh isContextMenuCommand() right
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
This is the only command I have thats successfully registered
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 9/28/2024 in #djs-questions
How do I make a Message Context Action
let commands = bot.application?.commands

commands?.create({
name: "info",
description: "Gives info"
})

const logSearchContextMenu = new ContextMenuCommandBuilder()
.setName('Get Time')
.setType(ApplicationCommandType.Message);
let commands = bot.application?.commands

commands?.create({
name: "info",
description: "Gives info"
})

const logSearchContextMenu = new ContextMenuCommandBuilder()
.setName('Get Time')
.setType(ApplicationCommandType.Message);
bot.on('interactionCreate', async (interaction) => {

logger.info('interactionCreate emitted', {"username": interaction.user.username, "userID": interaction.user.id,
"interactionType": interaction.type, "commandName": interaction.commandName, "guildName": interaction.member.guild.name, "channelID": interaction.channelId,
"message": interaction.targetMessage || undefined
})

const {commandName, options} = interaction

// Skip interactions that aren't commands or context menus since we don't do those
if(!interaction.isCommand() || !interaction.isContextMenu())
{
return;
}

if(commandName === "info")
{
interaction.reply({
content: `<REDACTED>`,
ephemeral: true
})
}

if(commandName === "Get Time")
{
interaction.reply({
content: `${interaction.targetMessage.createdAt}`,
ephemeral: true
})
}



})
bot.on('interactionCreate', async (interaction) => {

logger.info('interactionCreate emitted', {"username": interaction.user.username, "userID": interaction.user.id,
"interactionType": interaction.type, "commandName": interaction.commandName, "guildName": interaction.member.guild.name, "channelID": interaction.channelId,
"message": interaction.targetMessage || undefined
})

const {commandName, options} = interaction

// Skip interactions that aren't commands or context menus since we don't do those
if(!interaction.isCommand() || !interaction.isContextMenu())
{
return;
}

if(commandName === "info")
{
interaction.reply({
content: `<REDACTED>`,
ephemeral: true
})
}

if(commandName === "Get Time")
{
interaction.reply({
content: `${interaction.targetMessage.createdAt}`,
ephemeral: true
})
}



})
18 replies
DIAdiscord.js - Imagine an app
Created by Kiwi on 10/22/2022 in #djs-questions
Is there a way to check if a channel already has an active event on it?
Sorry I meant it as checking if the channel has a different event going on it before I try to make another one active in it
3 replies