Initiales Setup: minimaler Discord-Bot mit /ping, Docker-Deployment und README
- discord.js v14 Bot mit Slash-Command-Registry (Guild oder global) - Konfiguration über .env mit Validierung (config.js) - Dockerfile + docker-compose.yml für Portainer-Deployment - README mit Schritt-für-Schritt-Anleitung (Discord Developer Portal) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Lebenszeichen-Command: /ping → antwortet mit Latenz
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Lebenszeichen — zeigt die Bot-Latenz');
|
||||
|
||||
export async function execute(interaction) {
|
||||
const sent = await interaction.reply({ content: '🏓 Pong!', withResponse: true });
|
||||
const latency = sent.resource.message.createdTimestamp - interaction.createdTimestamp;
|
||||
await interaction.editReply(
|
||||
`🏓 Pong! Latenz: **${latency}ms** | API: **${Math.round(interaction.client.ws.ping)}ms**`
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user