remove server time
This commit is contained in:
parent
46684c09e3
commit
78d976d7f9
@ -69,7 +69,7 @@ async function handleApiCall(apiCall, userId, interaction) {
|
|||||||
function handleResponse(response, interaction, ephemeral = false) {
|
function handleResponse(response, interaction, ephemeral = false) {
|
||||||
if (response.success && typeof response === 'object' && Object.keys(response).length > 1) {
|
if (response.success && typeof response === 'object' && Object.keys(response).length > 1) {
|
||||||
// Extract the message if it exists, otherwise use a default description
|
// Extract the message if it exists, otherwise use a default description
|
||||||
const description = response.message ? response.message : '';
|
const description = response.message ? response.message : 'Success!';
|
||||||
|
|
||||||
// If there is a 'stats' field, handle it separately to format it correctly
|
// If there is a 'stats' field, handle it separately to format it correctly
|
||||||
if (response.stats) {
|
if (response.stats) {
|
||||||
@ -157,7 +157,7 @@ function handleResponse(response, interaction, ephemeral = false) {
|
|||||||
|
|
||||||
// Slash command definitions
|
// Slash command definitions
|
||||||
const commands = [
|
const commands = [
|
||||||
new SlashCommandBuilder().setName('server-time').setDescription('Get the server time'),
|
// new SlashCommandBuilder().setName('api-key-time').setDescription('Get the server time'),
|
||||||
new SlashCommandBuilder().setName('server-stats').setDescription('Get the server statistics'),
|
new SlashCommandBuilder().setName('server-stats').setDescription('Get the server statistics'),
|
||||||
new SlashCommandBuilder().setName('server-log').setDescription('Get the server log'),
|
new SlashCommandBuilder().setName('server-log').setDescription('Get the server log'),
|
||||||
new SlashCommandBuilder().setName('start-server').setDescription('Start the Minecraft server'),
|
new SlashCommandBuilder().setName('start-server').setDescription('Start the Minecraft server'),
|
||||||
@ -221,10 +221,10 @@ client.on('interactionCreate', async interaction => {
|
|||||||
const MyMC = new MyMCLib(apiToken);
|
const MyMC = new MyMCLib(apiToken);
|
||||||
|
|
||||||
switch (interaction.commandName) {
|
switch (interaction.commandName) {
|
||||||
case 'server-time':
|
// case 'server-time':
|
||||||
const timeData = await handleApiCall(() => MyMC.getTime(), userId, interaction);
|
// const timeData = await handleApiCall(() => MyMC.getTime(), userId, interaction);
|
||||||
handleResponse(timeData, interaction);
|
// handleResponse(timeData, interaction);
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case 'server-stats':
|
case 'server-stats':
|
||||||
const stats = await handleApiCall(() => MyMC.getStats(), userId, interaction);
|
const stats = await handleApiCall(() => MyMC.getStats(), userId, interaction);
|
||||||
|
Loading…
Reference in New Issue
Block a user