parent
67a7e165a1
commit
51ea3a4e52
6 changed files with 42 additions and 16 deletions
@ -0,0 +1,22 @@ |
|||||||
|
import {Interaction} from "discord.js"; |
||||||
|
import {Command} from "../command"; |
||||||
|
import {UEMEloBot} from "../bot"; |
||||||
|
|
||||||
|
class Update extends Command { |
||||||
|
constructor() { |
||||||
|
super("update", "Ränge jetzt aktualisieren (passiert automatisch alle 30min)"); |
||||||
|
} |
||||||
|
async execute(interaction: Interaction) { |
||||||
|
if (!interaction.isChatInputCommand()) |
||||||
|
return; |
||||||
|
|
||||||
|
await interaction.deferReply({ephemeral: true}); |
||||||
|
|
||||||
|
let client = interaction.client as UEMEloBot; |
||||||
|
await client.updatePlayers(); |
||||||
|
|
||||||
|
await interaction.editReply({content: "Aktualisiert!"}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export default new Update(); |
@ -0,0 +1,10 @@ |
|||||||
|
import {ChatInputCommandInteraction} from "discord.js"; |
||||||
|
|
||||||
|
export async function checkServer(interaction: ChatInputCommandInteraction){ |
||||||
|
const serverID = interaction.guild?.id; |
||||||
|
if (!serverID){ |
||||||
|
console.error("Server ID is missing!"); |
||||||
|
await interaction.reply({content: "Fehler!", ephemeral: true}); |
||||||
|
} |
||||||
|
return serverID; |
||||||
|
} |
Loading…
Reference in new issue