mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-04-02 09:44:14 +00:00
Updated Command Types
This commit is contained in:
parent
d89d13b31b
commit
6c523bbeba
11 changed files with 37 additions and 87 deletions
|
@ -1,19 +1,14 @@
|
||||||
import {
|
import {
|
||||||
CommandInteraction,
|
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
|
|
||||||
import { updateMember, updateMemberModerationHistory } from '../../db/db.js';
|
import { updateMember, updateMemberModerationHistory } from '../../db/db.js';
|
||||||
import { parseDuration, scheduleUnban } from '../../util/helpers.js';
|
import { parseDuration, scheduleUnban } from '../../util/helpers.js';
|
||||||
|
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||||
import logAction from '../../util/logging/logAction.js';
|
import logAction from '../../util/logging/logAction.js';
|
||||||
|
|
||||||
interface Command {
|
const command: OptionsCommand = {
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('ban')
|
.setName('ban')
|
||||||
.setDescription('Ban a member from the server')
|
.setDescription('Ban a member from the server')
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
import {
|
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||||
CommandInteraction,
|
|
||||||
PermissionsBitField,
|
|
||||||
SlashCommandBuilder,
|
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
} from 'discord.js';
|
|
||||||
import { executeUnban } from '../../util/helpers.js';
|
import { executeUnban } from '../../util/helpers.js';
|
||||||
|
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||||
|
|
||||||
interface Command {
|
const command: OptionsCommand = {
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('unban')
|
.setName('unban')
|
||||||
.setDescription('Unban a user from the server')
|
.setDescription('Unban a user from the server')
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
import {
|
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||||
CommandInteraction,
|
|
||||||
PermissionsBitField,
|
|
||||||
SlashCommandBuilder,
|
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
} from 'discord.js';
|
|
||||||
import { updateMemberModerationHistory } from '../../db/db.js';
|
import { updateMemberModerationHistory } from '../../db/db.js';
|
||||||
|
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||||
import logAction from '../../util/logging/logAction.js';
|
import logAction from '../../util/logging/logAction.js';
|
||||||
|
|
||||||
interface Command {
|
const command: OptionsCommand = {
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('warn')
|
.setName('warn')
|
||||||
.setDescription('Warn a member')
|
.setDescription('Warn a member')
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
import {
|
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||||
CommandInteraction,
|
|
||||||
PermissionsBitField,
|
|
||||||
SlashCommandBuilder,
|
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
} from 'discord.js';
|
|
||||||
|
|
||||||
interface Command {
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
import {
|
import { PermissionsBitField, SlashCommandBuilder } from 'discord.js';
|
||||||
CommandInteraction,
|
|
||||||
PermissionsBitField,
|
|
||||||
SlashCommandBuilder,
|
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
} from 'discord.js';
|
|
||||||
import { updateMember } from '../../db/db.js';
|
|
||||||
|
|
||||||
interface Command {
|
import { updateMember } from '../../db/db.js';
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import {
|
import {
|
||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
CommandInteraction,
|
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
ButtonBuilder,
|
ButtonBuilder,
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
|
@ -9,12 +8,9 @@ import {
|
||||||
APIEmbed,
|
APIEmbed,
|
||||||
JSONEncodable,
|
JSONEncodable,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { getAllMembers } from '../../db/db.js';
|
|
||||||
|
|
||||||
interface Command {
|
import { getAllMembers } from '../../db/db.js';
|
||||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
|
|
||||||
interface Command {
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
import {
|
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
|
||||||
SlashCommandBuilder,
|
|
||||||
CommandInteraction,
|
|
||||||
EmbedBuilder,
|
|
||||||
} from 'discord.js';
|
|
||||||
|
|
||||||
interface Command {
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const rulesEmbed = new EmbedBuilder()
|
const rulesEmbed = new EmbedBuilder()
|
||||||
.setColor(0x0099ff)
|
.setColor(0x0099ff)
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
|
|
||||||
interface Command {
|
import { Command } from '../../types/CommandTypes.js';
|
||||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
|
@ -1,19 +1,14 @@
|
||||||
import {
|
import {
|
||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
CommandInteraction,
|
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
SlashCommandOptionsOnlyBuilder,
|
|
||||||
GuildMember,
|
GuildMember,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
|
|
||||||
import { getMember } from '../../db/db.js';
|
import { getMember } from '../../db/db.js';
|
||||||
|
import { OptionsCommand } from '../../types/CommandTypes.js';
|
||||||
|
|
||||||
interface Command {
|
const command: OptionsCommand = {
|
||||||
data: SlashCommandOptionsOnlyBuilder;
|
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command: Command = {
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('userinfo')
|
.setName('userinfo')
|
||||||
.setDescription('Provides information about the specified user.')
|
.setDescription('Provides information about the specified user.')
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
import { CommandInteraction, SlashCommandBuilder } from 'discord.js';
|
import {
|
||||||
|
CommandInteraction,
|
||||||
|
SlashCommandBuilder,
|
||||||
|
SlashCommandOptionsOnlyBuilder,
|
||||||
|
} from 'discord.js';
|
||||||
|
|
||||||
export interface Command {
|
export interface Command {
|
||||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
||||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
execute: (interaction: CommandInteraction) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OptionsCommand {
|
||||||
|
data: SlashCommandOptionsOnlyBuilder;
|
||||||
|
execute: (interaction: CommandInteraction) => Promise<void>;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue