superfakenitro

This commit is contained in:
amy 2025-03-10 12:55:36 +03:30
parent e31beefa85
commit 27b7f9b5f8
No known key found for this signature in database
2 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,45 @@
import {Command} from "../command.ts";
import {
ApplicationIntegrationType,
ChatInputCommandInteraction,
InteractionContextType, REST, Routes,
SlashCommandBuilder
} from "discord.js";
import {config, Config} from "../config.ts";
export default class SuperFakeNitroCommand extends Command {
async run(interaction: ChatInputCommandInteraction, config: Config) {
const emojiname = interaction.options.getString("emoji");
const rest = new REST().setToken(config.token);
const data = await rest.get(
Routes.applicationEmojis(config.applicationid)
);
// @ts-ignore
const shit = data.items
const theemoji = shit.find((item: any) => item.name === emojiname);
let string = "<";
if (theemoji.animated) {
string += `a`;
}
string += `:`;
string += theemoji.name;
string += `:`;
string += theemoji.id;
string += `>`;
await interaction.reply(string);
}
slashCommand = new SlashCommandBuilder()
.setName("superfakenitro")
.setDescription("yeahh").setIntegrationTypes([
ApplicationIntegrationType.UserInstall
])
.addStringOption(option => {
return option.setName("emoji").setRequired(true).setDescription("the emojis name")
})
.setContexts([
InteractionContextType.BotDM,
InteractionContextType.Guild,
InteractionContextType.PrivateChannel
]);
}

View file

@ -4,6 +4,7 @@ const configT = z.object({
token: z.string(),
listenbrainzAccount: z.string(),
gitapi: z.string(),
applicationid: z.string(),
});
export type Config = z.infer<typeof configT>;
export const config: Config = configT.parse(rawconfig);