Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { config } from '../../modules/config/cfg';
- config.commands.handler.subcommand(
- {
- name: 'mc'
- },
- (subcmd) => {
- subcmd.on(
- {
- name: 'status',
- description: 'Check the current status of a Minecraft server.',
- filters: config.modules.permissions.user
- },
- (args) => ({
- input: args.text()
- }),
- async (message, { text }) => {
- const res = await fetch(`https://api.mcsrvstat.us/2/${text}`);
- const data = await res.text();
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.mc.enabled
- )
- return;
- await message.reply('Response:```json\n' + data + '```');
- }
- );
- }
- );
Add Comment
Please, Sign In to add comment