reformatted to use my template

This commit is contained in:
2022-03-31 15:04:54 -05:00
parent a9ea7bf8d5
commit 7bac005fe7
32 changed files with 8222 additions and 783 deletions

View File

@@ -0,0 +1,38 @@
import { CommandInteraction, TextChannel } from "discord.js";
import { InteractionRoles } from "./data";
import { sendRoles } from "../util/interactions";
export function RolesCommand(interaction: CommandInteraction) {
let category = interaction.options.getInteger('category', true);
sendRoles(interaction, InteractionRoles[category].id, true);
}
export async function RolesAllCommand(interaction: CommandInteraction) {
if (interaction.user.id === '167336999844315137') {
let givenChannel = interaction.options.getChannel('channel'),
channel: TextChannel = await interaction.client.channels.fetch(interaction.channelId) as TextChannel;
if (givenChannel && givenChannel.type === 'GUILD_TEXT')
channel = givenChannel as TextChannel;
if (channel) {
let category = interaction.options.getInteger('category');
sendRoles(channel, category ? InteractionRoles[category].id : undefined);
interaction.reply({
content: `sending message in <#${channel.id}>`,
ephemeral: true
})
} else
interaction.reply({
content: 'error finding channel to send message in',
ephemeral: true
})
} else
interaction.reply({
content: 'missing permissions',
ephemeral: true
})
}