Add map command
This commit is contained in:
parent
673172ecd3
commit
ca046bd709
7 changed files with 105 additions and 10 deletions
44
config/bot-sites.example.json
Normal file
44
config/bot-sites.example.json
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[
|
||||
{
|
||||
"name": "top.gg",
|
||||
"enabled": false,
|
||||
"url": "https://top.gg/api/bots/<BOT_ID>/stats",
|
||||
"authorization": "<TOKEN>",
|
||||
"body": "{\"server_count\":{{SERVER_COUNT}}}"
|
||||
},
|
||||
{
|
||||
"name": "bots.ondiscord.xyz",
|
||||
"enabled": false,
|
||||
"url": "https://bots.ondiscord.xyz/bot-api/bots/<BOT_ID>/guilds",
|
||||
"authorization": "<TOKEN>",
|
||||
"body": "{\"guildCount\":{{SERVER_COUNT}}}"
|
||||
},
|
||||
{
|
||||
"name": "discord.bots.gg",
|
||||
"enabled": false,
|
||||
"url": "https://discord.bots.gg/api/v1/bots/<BOT_ID>/stats",
|
||||
"authorization": "<TOKEN>",
|
||||
"body": "{\"guildCount\":{{SERVER_COUNT}}}"
|
||||
},
|
||||
{
|
||||
"name": "discordbotlist.com",
|
||||
"enabled": false,
|
||||
"url": "https://discordbotlist.com/api/bots/<BOT_ID>/stats",
|
||||
"authorization": "Bot <TOKEN>",
|
||||
"body": "{\"guilds\":{{SERVER_COUNT}}}"
|
||||
},
|
||||
{
|
||||
"name": "discords.com",
|
||||
"enabled": false,
|
||||
"url": "https://discords.com/bots/api/bot/<BOT_ID>",
|
||||
"authorization": "<TOKEN>",
|
||||
"body": "{\"server_count\":{{SERVER_COUNT}}}"
|
||||
},
|
||||
{
|
||||
"name": "disforge.com",
|
||||
"enabled": false,
|
||||
"url": "https://disforge.com/api/botstats/<BOT_ID>",
|
||||
"authorization": "<TOKEN>",
|
||||
"body": "{\"servers\":{{SERVER_COUNT}}}"
|
||||
}
|
||||
]
|
||||
|
|
@ -33,6 +33,10 @@
|
|||
"Sorry but we don't currently support Bedrock due to TCPShield charging $100/mo for geyser support.\n\n(They offer than just this for the plan).\n\n:( Maybe consider donating?"
|
||||
]
|
||||
},
|
||||
"servermap": {
|
||||
"title": "**Dynmap for {{SERVER}}**",
|
||||
"description": ["{{LINK}}"]
|
||||
},
|
||||
"helpContactSupport": {
|
||||
"title": "Help - {{REF:helpOptions.contactSupport}}",
|
||||
"description": [
|
||||
|
|
@ -211,7 +215,8 @@
|
|||
"help": "help",
|
||||
"info": "info",
|
||||
"test": "test",
|
||||
"howtojoin": "howtojoin"
|
||||
"howtojoin": "howtojoin",
|
||||
"map": "map"
|
||||
},
|
||||
"userCommands": {
|
||||
"viewDateJoined": "View Date Joined"
|
||||
|
|
@ -222,20 +227,23 @@
|
|||
"arguments": {
|
||||
"command": "command",
|
||||
"option": "option",
|
||||
"platform": "platform"
|
||||
"platform": "platform",
|
||||
"server": "server"
|
||||
},
|
||||
"commandDescs": {
|
||||
"dev": "Developer use only.",
|
||||
"help": "Find help or contact support.",
|
||||
"info": "View bot info.",
|
||||
"test": "Run the test command.",
|
||||
"howtojoin": "How To Join"
|
||||
"howtojoin": "How To Join.",
|
||||
"map": "The dynmap for the server."
|
||||
},
|
||||
"argDescs": {
|
||||
"devCommand": "Command.",
|
||||
"helpOption": "Option.",
|
||||
"infoOption": "Option.",
|
||||
"platform": "Ex. PC, Xbox, Playstation, Mobile."
|
||||
"platform": "Ex. PC, Xbox, Playstation, Mobile.",
|
||||
"server": "The server's name"
|
||||
},
|
||||
"fields": {
|
||||
"commands": "Commands",
|
||||
|
|
|
|||
|
|
@ -64,4 +64,11 @@ export class Args {
|
|||
description_localizations: Lang.getRefLocalizationMap('argDescs.platform'),
|
||||
type: ApplicationCommandOptionType.String,
|
||||
};
|
||||
public static readonly server: APIApplicationCommandBasicOption = {
|
||||
name: Lang.getRef('arguments.server', Language.Default),
|
||||
name_localizations: Lang.getRefLocalizationMap('arguments.server'),
|
||||
description: Lang.getRef('argDescs.server', Language.Default),
|
||||
description_localizations: Lang.getRefLocalizationMap('argDescs.server'),
|
||||
type: ApplicationCommandOptionType.String,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@ export { HelpCommand } from './help-command.js';
|
|||
export { InfoCommand } from './info-command.js';
|
||||
export { TestCommand } from './test-command.js';
|
||||
export { HowToJoinCommand } from './information/howtojoin-command.js';
|
||||
export { MapCommand } from './information/map-command.js';
|
||||
|
|
|
|||
|
|
@ -19,18 +19,36 @@ export class MapCommand implements Command {
|
|||
};
|
||||
|
||||
// Check if the user entered "Survival"
|
||||
if (args.Server.toLowerCase() === "survival") {
|
||||
await intr.reply('Here is the link for Survival: https://map.pxlvrs.net/survival');
|
||||
if (args.Server.toLowerCase() === 'survival') {
|
||||
await InteractionUtils.send(
|
||||
intr,
|
||||
Lang.getEmbed('displayEmbeds.servermap', data.lang, {
|
||||
SERVER: 'Survival',
|
||||
LINK: 'https://map.pxlvrs.net/survival',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// Check if the user entered "LifeSteal"
|
||||
else if (args.Server.toLowerCase() === "lifesteal") {
|
||||
await intr.reply('Here is the link for LifeSteal: https://map.pxlvrs.net/lifesteal');
|
||||
else if (args.Server.toLowerCase() === 'lifesteal') {
|
||||
await InteractionUtils.send(
|
||||
intr,
|
||||
Lang.getEmbed('displayEmbeds.servermap', data.lang, {
|
||||
SERVER: 'LifeSteal',
|
||||
LINK: 'https://map.pxlvrs.net/lifesteal',
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// If the input is not recognized, provide valid inputs
|
||||
else {
|
||||
await intr.reply('Invalid input. Valid options are: Survival, LifeSteal');
|
||||
await InteractionUtils.send(
|
||||
intr,
|
||||
Lang.getEmbed('displayEmbeds.servermap', data.lang, {
|
||||
SERVER: 'N/A',
|
||||
LINK: 'Invalid input. Valid options are: Survival, LifeSteal',
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +84,21 @@ export const ChatCommandMetadata: {
|
|||
},
|
||||
],
|
||||
},
|
||||
MAP: {
|
||||
type: ApplicationCommandType.ChatInput,
|
||||
name: Lang.getRef('chatCommands.map', Language.Default),
|
||||
name_localizations: Lang.getRefLocalizationMap('chatCommands.map'),
|
||||
description: Lang.getRef('commandDescs.map', Language.Default),
|
||||
description_localizations: Lang.getRefLocalizationMap('commandDescs.map'),
|
||||
dm_permission: true,
|
||||
default_member_permissions: undefined,
|
||||
options: [
|
||||
{
|
||||
...Args.server,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const MessageCommandMetadata: {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {
|
|||
InfoCommand,
|
||||
TestCommand,
|
||||
HowToJoinCommand,
|
||||
MapCommand
|
||||
} from './commands/chat/index.js';
|
||||
import {
|
||||
ChatCommandMetadata,
|
||||
|
|
@ -75,6 +76,7 @@ async function start(): Promise<void> {
|
|||
|
||||
// TODO: Add new commands here
|
||||
new HowToJoinCommand(),
|
||||
new MapCommand(),
|
||||
];
|
||||
|
||||
// Buttons
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue