initial commit
Some checks failed
release-tag / release-image (push) Failing after 1m14s

This commit is contained in:
konchin
2024-10-11 19:49:58 +08:00
commit 2d7361e937
38 changed files with 4029 additions and 0 deletions

19
commands/utils/help.ts Normal file
View File

@@ -0,0 +1,19 @@
import {CommandInteraction} from 'discord.js';
import {Command} from '../../classes/command';
import {logger} from '../../logger';
import {config} from '../../config';
class Help extends Command{
get name(){return "help";}
get description(){return "Help messages.";}
async execute(interaction: CommandInteraction): Promise<void>{
await interaction.reply({content:
"# [Help](https://hello.konchin.com)\n"+
`Read the documentation at [this link](${config.helpUrl})\n`
});
logger.log(`Command: help`);
}
};
export const command = new Help();

20
commands/utils/ping.ts Normal file
View File

@@ -0,0 +1,20 @@
import {CommandInteraction} from 'discord.js';
import {Command} from '../../classes/command';
import {logger} from '../../logger';
class Ping extends Command{
get name(){return "ping";}
get description(){return "Reply with the RTT of this bot.";}
async execute(interaction: CommandInteraction): Promise<void>{
const sent = await interaction.reply({
content: "Pinging...",
ephemeral: true,
fetchReply: true,
});
const rtt = sent.createdTimestamp - interaction.createdTimestamp;
await interaction.editReply(`Roundtrip latency: ${rtt}ms`);
logger.log(`ping with rtt: ${rtt}`);
}
};
export const command = new Ping();