superfakenitro
This commit is contained in:
parent
e31beefa85
commit
27b7f9b5f8
2 changed files with 46 additions and 0 deletions
45
src/commands/superfakenitro.ts
Normal file
45
src/commands/superfakenitro.ts
Normal 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
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ const configT = z.object({
|
||||||
token: z.string(),
|
token: z.string(),
|
||||||
listenbrainzAccount: z.string(),
|
listenbrainzAccount: z.string(),
|
||||||
gitapi: z.string(),
|
gitapi: z.string(),
|
||||||
|
applicationid: z.string(),
|
||||||
});
|
});
|
||||||
export type Config = z.infer<typeof configT>;
|
export type Config = z.infer<typeof configT>;
|
||||||
export const config: Config = configT.parse(rawconfig);
|
export const config: Config = configT.parse(rawconfig);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue