This commit is contained in:
2026-08-26 15:31:25 +08:00
parent 0ac0dffce4
commit 59518f7b99
4 changed files with 12 additions and 8 deletions
+9 -3
View File
@@ -4,15 +4,18 @@ import config from "../../config";
// ----------
@SlashCommand(
new CommandBuilder('init', 'Configure bot & settings.')
new CommandBuilder('init', 'Runs pre-start operations, then starts the bot for operation.')
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
.setContexts(Constants.InteractionContextType.Guild)
.setCommandType(Constants.ApplicationCommandType.ChatInput)
)
class InitCommand extends Command<CommandClient> {
users = ['1363132678022631428'];
users = [
'1363132678022631428', // nxbat
'454653142500507649' // bitdash
];
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
async #createInformationMessage(context: CommandClient<any, any>, interaction: CommandInteraction) {
await context.createMessage(interaction.channel.id, {
embed: {
color: 0xe77ed1,
@@ -37,7 +40,10 @@ class InitCommand extends Command<CommandClient> {
}
}
});
}
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
for (const handler of [this.#createInformationMessage]) await handler(context, interaction);
await interaction.createMessage({ content: 'Done.', flags: Constants.MessageFlags.Ephemeral });
}
}
+3 -2
View File
@@ -1,9 +1,10 @@
import init from "./admin/init";
import wipe from "./admin/wipe";
import prune from "./admin/prune";
import leaderboard from "./leaderboard";
import optin from "./privacy/optin";
import optout from "./privacy/optout";
import profile from "./profile";
// ----------
export default [init, optin, optout, profile, wipe];
export default [init, leaderboard, optin, optout, profile, prune];
-1
View File
@@ -12,7 +12,6 @@ const client: CommandClient = new CommandClient({
options: {
intents: [
Constants.GatewayIntentBits.Guilds,
Constants.GatewayIntentBits.GuildMembers,
Constants.GatewayIntentBits.GuildMessages,
Constants.GatewayIntentBits.GuildMessageReactions
],
-2
View File
@@ -32,8 +32,6 @@ export async function getUser(userId: string): Promise<User> {
DO NOTHING
RETURNING user_id, data
`;
}
export async function setUser(userId: string, data: User): Promise<void> {