generated from nhcarrigan/template
This commit is contained in:
@@ -35,5 +35,11 @@ amari.discord.on(Events.MessageCreate, (message) => {
|
||||
void handleMessageCreate(amari, message);
|
||||
});
|
||||
|
||||
amari.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
if (interaction.isButton() && interaction.customId === "resolve") {
|
||||
void interaction.message.delete();
|
||||
}
|
||||
});
|
||||
|
||||
await amari.discord.login(process.env.BOT_TOKEN);
|
||||
instantiateServer();
|
||||
|
||||
@@ -14,6 +14,7 @@ import type { User, APIMessageTopLevelComponent } from "discord.js";
|
||||
* @returns An array of message component objects.
|
||||
*/
|
||||
export const getComponentsForNaomi
|
||||
// eslint-disable-next-line max-lines-per-function -- Seriously??
|
||||
= (
|
||||
author: User,
|
||||
content: string,
|
||||
@@ -56,6 +57,17 @@ export const getComponentsForNaomi
|
||||
type: 2,
|
||||
url: url,
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Discord API convention.
|
||||
custom_id: "resolve",
|
||||
disabled: false,
|
||||
emoji: {
|
||||
name: "✅",
|
||||
},
|
||||
label: "resolve",
|
||||
style: 3,
|
||||
type: 2,
|
||||
},
|
||||
],
|
||||
type: 1,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user