Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { config } from '../modules/config';
- import { permissions } from '../modules/permissions';
- config.commands.handler.subcommand(
- {
- name: 'mc'
- },
- (subcmd) => {
- subcmd.on(
- {
- name: 'status',
- description: 'Check the current status of a Minecraft server.',
- filters: 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 + '```');
- }
- );
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement