Updated Command Types

This commit is contained in:
Ahmad 2025-02-28 23:23:39 -05:00
parent d89d13b31b
commit 6c523bbeba
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
11 changed files with 37 additions and 87 deletions

View file

@ -1,19 +1,14 @@
import {
CommandInteraction,
PermissionsBitField,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
import { updateMember, updateMemberModerationHistory } from '../../db/db.js';
import { parseDuration, scheduleUnban } from '../../util/helpers.js';
import { OptionsCommand } from '../../types/CommandTypes.js';
import logAction from '../../util/logging/logAction.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
const command: OptionsCommand = {
data: new SlashCommandBuilder()
.setName('ban')
.setDescription('Ban a member from the server')

View file

@ -1,17 +1,9 @@
import {
CommandInteraction,
PermissionsBitField,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
import { executeUnban } from '../../util/helpers.js';
import { OptionsCommand } from '../../types/CommandTypes.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
const command: OptionsCommand = {
data: new SlashCommandBuilder()
.setName('unban')
.setDescription('Unban a user from the server')

View file

@ -1,18 +1,10 @@
import {
CommandInteraction,
PermissionsBitField,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
import { updateMemberModerationHistory } from '../../db/db.js';
import { OptionsCommand } from '../../types/CommandTypes.js';
import logAction from '../../util/logging/logAction.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
const command: OptionsCommand = {
data: new SlashCommandBuilder()
.setName('warn')
.setDescription('Warn a member')

View file

@ -1,14 +1,6 @@
import {
CommandInteraction,
PermissionsBitField,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { Command } from '../../types/CommandTypes.js';
const command: Command = {
data: new SlashCommandBuilder()

View file

@ -1,15 +1,7 @@
import {
CommandInteraction,
PermissionsBitField,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
import { updateMember } from '../../db/db.js';
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { updateMember } from '../../db/db.js';
import { Command } from '../../types/CommandTypes.js';
const command: Command = {
data: new SlashCommandBuilder()

View file

@ -1,6 +1,5 @@
import {
SlashCommandBuilder,
CommandInteraction,
EmbedBuilder,
ButtonBuilder,
ActionRowBuilder,
@ -9,12 +8,9 @@ import {
APIEmbed,
JSONEncodable,
} from 'discord.js';
import { getAllMembers } from '../../db/db.js';
interface Command {
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { getAllMembers } from '../../db/db.js';
import { Command } from '../../types/CommandTypes.js';
const command: Command = {
data: new SlashCommandBuilder()

View file

@ -1,9 +1,6 @@
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
import { SlashCommandBuilder } from 'discord.js';
interface Command {
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { Command } from '../../types/CommandTypes.js';
const command: Command = {
data: new SlashCommandBuilder()

View file

@ -1,13 +1,6 @@
import {
SlashCommandBuilder,
CommandInteraction,
EmbedBuilder,
} from 'discord.js';
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
interface Command {
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { Command } from '../../types/CommandTypes.js';
const rulesEmbed = new EmbedBuilder()
.setColor(0x0099ff)

View file

@ -1,9 +1,6 @@
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
import { SlashCommandBuilder } from 'discord.js';
interface Command {
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
execute: (interaction: CommandInteraction) => Promise<void>;
}
import { Command } from '../../types/CommandTypes.js';
const command: Command = {
data: new SlashCommandBuilder()

View file

@ -1,19 +1,14 @@
import {
SlashCommandBuilder,
CommandInteraction,
EmbedBuilder,
SlashCommandOptionsOnlyBuilder,
GuildMember,
PermissionsBitField,
} from 'discord.js';
import { getMember } from '../../db/db.js';
import { OptionsCommand } from '../../types/CommandTypes.js';
interface Command {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
const command: OptionsCommand = {
data: new SlashCommandBuilder()
.setName('userinfo')
.setDescription('Provides information about the specified user.')

View file

@ -1,6 +1,15 @@
import { CommandInteraction, SlashCommandBuilder } from 'discord.js';
import {
CommandInteraction,
SlashCommandBuilder,
SlashCommandOptionsOnlyBuilder,
} from 'discord.js';
export interface Command {
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
execute: (interaction: CommandInteraction) => Promise<void>;
}
export interface OptionsCommand {
data: SlashCommandOptionsOnlyBuilder;
execute: (interaction: CommandInteraction) => Promise<void>;
}