add selector

This commit is contained in:
ChomeNS 2022-11-16 18:41:30 +07:00
parent 059f7bf6af
commit e7d75fab44
42 changed files with 115 additions and 104 deletions

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Sudo everyone on Ayunboom!', description: 'Sudo everyone on Ayunboom!',
trusted: 1, trusted: 1,
usage: '<hash> <c:|command>', usage: '<hash> <c:|command>',
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`); bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`);
} else { } else {

View file

@ -6,8 +6,8 @@ module.exports = {
description: 'Shows the bot\'s username and UUID', description: 'Shows the bot\'s username and UUID',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [{text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the UUID to your clipboard', color: 'green'}]}}]); bot.tellraw(selector, [{text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the UUID to your clipboard', color: 'green'}]}}]);
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -6,16 +6,16 @@ module.exports = {
description: 'Changes the bot\'s visibility', description: 'Changes the bot\'s visibility',
usage: '<hash> <true|false>', usage: '<hash> <true|false>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
if (args[1] === 'true') { if (args[1] === 'true') {
bot.visibility = true; bot.visibility = true;
bot.chat('/essentials:vanish disable'); bot.chat('/essentials:vanish disable');
bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]); bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]);
} else if (args[1] === 'false') { } else if (args[1] === 'false') {
bot.visibility = false; bot.visibility = false;
bot.chat('/essentials:vanish enable'); bot.chat('/essentials:vanish enable');
bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]); bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]);
} else { } else {
throw new SyntaxError('Invalid argument'); throw new SyntaxError('Invalid argument');
} }

View file

@ -6,7 +6,7 @@ module.exports = {
description: 'RecycleBot bruhify but actionbar', description: 'RecycleBot bruhify but actionbar',
usage: '<message>', usage: '<message>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.bruhifyText = args.join(' '); bot.bruhifyText = args.join(' ');
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Executes a command in the command core', description: 'Executes a command in the command core',
usage: '<command>', usage: '<command>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.core.run(args.join(' ')); bot.core.run(args.join(' '));
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -7,11 +7,11 @@ module.exports = {
description: 'Shows the bot\'s changelog', description: 'Shows the bot\'s changelog',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [{text: 'Changelogs:', color: 'green'}]); bot.tellraw(selector, [{text: 'Changelogs:', color: 'green'}]);
changelog.forEach((message, number) => { changelog.forEach((message, number) => {
number += 1; number += 1;
bot.tellraw('@a', [{text: `${number}`, color: 'gray'}, {text: ' - ', color: 'dark_gray'}, {text: message, color: 'gray'}]); bot.tellraw(selector, [{text: `${number}`, color: 'gray'}, {text: ' - ', color: 'dark_gray'}, {text: message, color: 'gray'}]);
}); });
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -6,12 +6,12 @@ module.exports = {
description: 'Clears the chat', description: 'Clears the chat',
usage: '[specific] <player>', usage: '[specific] <player>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === 'specific') { if (args[0] === 'specific') {
bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username}.`, color: 'dark_green'}]); bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username}.`, color: 'dark_green'}]);
return; return;
} else { } else {
bot.tellraw('@a', [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: 'The chat has been cleared.', color: 'dark_green'}]); bot.tellraw(selector, [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: 'The chat has been cleared.', color: 'dark_green'}]);
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
@ -19,7 +19,7 @@ module.exports = {
bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green'}]); bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green'}]);
return; return;
} else { } else {
bot.tellraw('@a', [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: 'The chat has been cleared.', color: 'dark_green'}]); bot.tellraw(selector, [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: 'The chat has been cleared.', color: 'dark_green'}]);
} }
}, },
}; };

View file

@ -4,7 +4,7 @@ module.exports = {
alias: ['ccq'], alias: ['ccq'],
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (bot.queue[0]) { if (bot.queue[0]) {
bot.queue = []; bot.queue = [];
} }

View file

@ -53,7 +53,7 @@ function list(bot, discord, channeldc) {
message.pop(); message.pop();
bot.tellraw('@a', message); bot.tellraw(selector, message);
} }
module.exports = { module.exports = {
name: 'cloop', name: 'cloop',
@ -66,22 +66,22 @@ module.exports = {
'<hash> <list>', '<hash> <list>',
], ],
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (!bot.cloops) bot.cloops = []; if (!bot.cloops) bot.cloops = [];
if (args[0] === hash) { if (args[0] === hash) {
if (args[1] === 'add' && args[3]) { if (args[1] === 'add' && args[3]) {
if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval'); if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval');
add(args.slice(3).join(' '), args[2], bot); add(args.slice(3).join(' '), args[2], bot);
bot.tellraw('@a', [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]); bot.tellraw(selector, [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]);
} else if (args[1] === 'list') { } else if (args[1] === 'list') {
list(bot); list(bot);
} else if (args[1] === 'remove') { } else if (args[1] === 'remove') {
remove(args[2]); remove(args[2]);
bot.tellraw('@a', [{text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]); bot.tellraw(selector, [{text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]);
} else if (args[1] === 'removeall') { } else if (args[1] === 'removeall') {
clear(); clear();
bot.tellraw('@a', [{text: 'Removed all looped commands', color: 'white'}]); bot.tellraw(selector, [{text: 'Removed all looped commands', color: 'white'}]);
} else { } else {
throw new SyntaxError('Invalid argument'); throw new SyntaxError('Invalid argument');
} }

View file

@ -7,7 +7,7 @@ module.exports = {
description: 'Moo', description: 'Moo',
usage: '<cow|list> <message>', usage: '<cow|list> <message>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0]==='list') { if (args[0]==='list') {
const listed = Object.keys(cows); const listed = Object.keys(cows);
@ -30,9 +30,9 @@ module.exports = {
}); });
}); });
bot.tellraw('@a', message); bot.tellraw(selector, message);
} else { } else {
bot.tellraw('@a', {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`}); bot.tellraw(selector, {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`});
} }
}, },
}; };

View file

@ -15,7 +15,7 @@ module.exports = {
description: 'Crashes the server', description: 'Crashes the server',
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
crash(bot); crash(bot);
} else { } else {

View file

@ -6,8 +6,8 @@ module.exports = {
description: 'Shows the bot\'s creator', description: 'Shows the bot\'s creator',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [{text: 'ChomeNS Bot ', color: 'yellow'}, {text: 'was created by ', color: 'white'}, {text: 'chayapak', color: 'gold'}]); bot.tellraw(selector, [{text: 'ChomeNS Bot ', color: 'yellow'}, {text: 'was created by ', color: 'white'}, {text: 'chayapak', color: 'gold'}]);
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -4,8 +4,8 @@ module.exports = {
description: 'Shows the discord invite', description: 'Shows the discord invite',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: 'The Discord invite is ', text: 'The Discord invite is ',
color: 'white', color: 'white',

View file

@ -34,7 +34,7 @@ module.exports = {
bot.draw(data, info); bot.draw(data, info);
} catch (e) { } catch (e) {
bot.tellraw('@a', {text: 'SyntaxError: Invalid URL', color: 'red'}); bot.tellraw(selector, {text: 'SyntaxError: Invalid URL', color: 'red'});
} }
}, },
}; };

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Lags Eaglercraft and crashes it', description: 'Lags Eaglercraft and crashes it',
usage: '<on|off> <hash>', usage: '<on|off> <hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[1] === 'on') { if (args[1] === 'on') {
if (args[0] === hash) { if (args[0] === hash) {
bot.eaglercrashstarted = true; bot.eaglercrashstarted = true;

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Says a message', description: 'Says a message',
usage: '<message>', usage: '<message>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.chat(args.join(' ')); bot.chat(args.join(' '));
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Ends the bot\'s client', description: 'Ends the bot\'s client',
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.end('end command'); bot.end('end command');
} else { } else {

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Summon any entity!', description: 'Summon any entity!',
usage: '[specific] <player>', usage: '[specific] <player>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const mcData = require('minecraft-data')(bot.version); const mcData = require('minecraft-data')(bot.version);
@ -15,10 +15,10 @@ module.exports = {
// if (!entity) throw new SyntaxError('Invalid entity'); // if (!entity) throw new SyntaxError('Invalid entity');
// if (!args[1]) { // if (!args[1]) {
// bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name); // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name);
// bot.tellraw('@a', [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]); // bot.tellraw(selector, [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]);
// } else if (args[1] === 'specific' && args[2]) { // } else if (args[1] === 'specific' && args[2]) {
// bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name); // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name);
// bot.tellraw('@a', [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]); // bot.tellraw(selector, [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]);
// } // }
}, },
}; };

View file

@ -15,12 +15,12 @@ module.exports = {
'<reset>', '<reset>',
'<server (eval server)> <code>', '<server (eval server)> <code>',
], ],
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === 'run') { if (args[0] === 'run') {
try { try {
bot.tellraw('@a', {text: `${util.inspect(bot.vm.run(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 32000)}); bot.tellraw(selector, {text: `${util.inspect(bot.vm.run(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 32000)});
} catch (err) { } catch (err) {
bot.tellraw('@a', {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'}); bot.tellraw(selector, {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'});
} }
} }
if (args[0] === 'reset') { if (args[0] === 'reset') {
@ -34,9 +34,9 @@ module.exports = {
colors: 'minecraft', colors: 'minecraft',
code: args[1], code: args[1],
})).then((res) => { })).then((res) => {
bot.tellraw('@a', {text: `${res.data}`}); bot.tellraw(selector, {text: `${res.data}`});
}).catch((err) => { }).catch((err) => {
bot.tellraw('@a', {text: `${err}`, color: 'red'}); bot.tellraw(selector, {text: `${err}`, color: 'red'});
}); });
} }
// if (args[0] === 'dineval') { // if (args[0] === 'dineval') {
@ -47,9 +47,9 @@ module.exports = {
// colors: 'minecraft', // colors: 'minecraft',
// }, // },
// }).then((res) => { // }).then((res) => {
// bot.tellraw('@a', {text: `${res.data}`})); // bot.tellraw(selector, {text: `${res.data}`}));
// }).catch((e) => { // }).catch((e) => {
// bot.tellraw('@a', {text: `${e}`, color: 'red'}); // bot.tellraw(selector, {text: `${e}`, color: 'red'});
// }); // });
// } // }
}, },

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Execute command bypassed', description: 'Execute command bypassed',
usage: '<hash> <command>', usage: '<hash> <command>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.core.run('minecraft:execute unless entity @s[name= run ] run ' + args.slice(1).join(' ')); bot.core.run('minecraft:execute unless entity @s[name= run ] run ' + args.slice(1).join(' '));
} else { } else {

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Gamemode everyone', description: 'Gamemode everyone',
usage: '<hash> <gamemode>', usage: '<hash> <gamemode>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.core.run(`minecraft:execute unless entity @s[name= run ] run gamemode ${args[1]} @a[name=!${bot.username}]`); bot.core.run(`minecraft:execute unless entity @s[name= run ] run gamemode ${args[1]} @a[name=!${bot.username}]`);
} else { } else {

View file

@ -8,7 +8,7 @@ module.exports = {
description: 'Shows the help', description: 'Shows the help',
usage: '[command]', usage: '[command]',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
const generalCommands = []; const generalCommands = [];
const trustedCommands = []; const trustedCommands = [];
const ownerCommands = []; const ownerCommands = [];
@ -68,10 +68,10 @@ module.exports = {
usage.pop(); usage.pop();
} }
bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]); bot.tellraw(selector, [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]);
bot.tellraw('@a', [{text: 'Trust level: ', color: 'green'}, {text: command.trusted, color: 'yellow'}]); bot.tellraw(selector, [{text: 'Trust level: ', color: 'green'}, {text: command.trusted, color: 'yellow'}]);
bot.tellraw('@a', [{text: 'Supported on Discord: ', color: 'green'}, {text: discordSupported, color: 'gold'}]); bot.tellraw(selector, [{text: 'Supported on Discord: ', color: 'green'}, {text: discordSupported, color: 'gold'}]);
bot.tellraw('@a', usage); bot.tellraw(selector, usage);
} }
if (command.name === args[0]) run(); if (command.name === args[0]) run();
@ -81,7 +81,7 @@ module.exports = {
}; };
} else { } else {
const pre = [{text: 'Commands ', color: 'gray'}, {text: '(', color: 'dark_gray'}, {text: 'Length: ', color: 'gray'}, {text: bot.command_handler.commands.length, color: 'green'}, {text: ') ', color: 'dark_gray'}, {text: '(', color: 'dark_gray'}, {text: '⬤ Public', color: 'green'}, {text: ' ⬤ Trusted', color: 'red'}, {text: ' ⬤ Owner', color: 'dark_red'}, {text: ') - ', color: 'dark_gray'}]; const pre = [{text: 'Commands ', color: 'gray'}, {text: '(', color: 'dark_gray'}, {text: 'Length: ', color: 'gray'}, {text: bot.command_handler.commands.length, color: 'green'}, {text: ') ', color: 'dark_gray'}, {text: '(', color: 'dark_gray'}, {text: '⬤ Public', color: 'green'}, {text: ' ⬤ Trusted', color: 'red'}, {text: ' ⬤ Owner', color: 'dark_red'}, {text: ') - ', color: 'dark_gray'}];
bot.tellraw('@a', [pre, generalCommands, trustedCommands, ownerCommands]); bot.tellraw(selector, [pre, generalCommands, trustedCommands, ownerCommands]);
} }
}, },
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -53,7 +53,7 @@ module.exports = {
component.push('\n'); component.push('\n');
} }
component.pop(); component.pop();
bot.tellraw('@a', component); bot.tellraw(selector, component);
} catch (e) { } catch (e) {
return; return;
} }

View file

@ -1,3 +1,4 @@
/* eslint-disable require-jsdoc */
/* eslint-disable max-len */ /* eslint-disable max-len */
const fs = require('fs/promises'); const fs = require('fs/promises');
const {MessageEmbed} = require('discord.js'); const {MessageEmbed} = require('discord.js');
@ -15,7 +16,7 @@ if (os.hostname() === 'chomens-kubuntu') {
SONGS_PATH = path.join(__dirname, '..', 'midis'); SONGS_PATH = path.join(__dirname, '..', 'midis');
} }
async function play(bot, values, discord, channeldc) { async function play(bot, values, discord, channeldc, selector) {
try { try {
const filepath = values.join(' '); const filepath = values.join(' ');
const absolutePath = await resolve(filepath); const absolutePath = await resolve(filepath);
@ -29,7 +30,7 @@ async function play(bot, values, discord, channeldc) {
.setDescription(`Added ${song.name} to the song queue`); .setDescription(`Added ${song.name} to the song queue`);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else {
bot.tellraw('@a', [{text: 'Added ', color: 'white'}, {text: song.name, color: 'gold'}, {text: ' to the song queue', color: 'white'}]); bot.tellraw(selector, [{text: 'Added ', color: 'white'}, {text: song.name, color: 'gold'}, {text: ' to the song queue', color: 'white'}]);
} }
} catch (e) { } catch (e) {
if (discord) { if (discord) {
@ -39,12 +40,12 @@ async function play(bot, values, discord, channeldc) {
.setDescription(`\`\`\`SyntaxError: Invalid file\`\`\``); .setDescription(`\`\`\`SyntaxError: Invalid file\`\`\``);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else {
bot.tellraw('@a', {text: 'SyntaxError: Invalid file', color: 'red'}); bot.tellraw(selector, {text: 'SyntaxError: Invalid file', color: 'red'});
} }
} }
} }
async function playUrl(bot, values, discord, channeldc) { async function playUrl(bot, values, discord, channeldc, selector) {
try { try {
const url = values.join(' '); const url = values.join(' ');
const response = await axios.get('https://http-proxy.nongsonchome.repl.co', { const response = await axios.get('https://http-proxy.nongsonchome.repl.co', {
@ -63,7 +64,7 @@ async function playUrl(bot, values, discord, channeldc) {
.setDescription(`Added ${song.name} to the song queue`); .setDescription(`Added ${song.name} to the song queue`);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else {
bot.tellraw('@a', [{text: 'Added ', color: 'white'}, {text: song.name, color: 'gold'}, {text: ' to the song queue', color: 'white'}]); bot.tellraw(selector, [{text: 'Added ', color: 'white'}, {text: song.name, color: 'gold'}, {text: ' to the song queue', color: 'white'}]);
} }
} catch (e) { } catch (e) {
if (discord) { if (discord) {
@ -73,7 +74,7 @@ async function playUrl(bot, values, discord, channeldc) {
.setDescription(`\`\`\`SyntaxError: Invalid URL\`\`\``); .setDescription(`\`\`\`SyntaxError: Invalid URL\`\`\``);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else {
bot.tellraw('@a', {text: 'SyntaxError: Invalid URL', color: 'red'}); bot.tellraw(selector, {text: 'SyntaxError: Invalid URL', color: 'red'});
} }
} }
} }
@ -85,7 +86,7 @@ async function resolve(filepath) {
return filepath; return filepath;
} }
async function list(bot, discord, channeldc, prefix) { async function list(bot, discord, channeldc, prefix, selector) {
const absolutePath = await resolve(SONGS_PATH); const absolutePath = await resolve(SONGS_PATH);
const listed = await fileList(absolutePath); const listed = await fileList(absolutePath);
@ -125,7 +126,7 @@ async function list(bot, discord, channeldc, prefix) {
}}); }});
}); });
bot.tellraw('@a', message); bot.tellraw(selector, message);
}; };
module.exports = { module.exports = {
@ -143,17 +144,17 @@ module.exports = {
'<nowplaying>', '<nowplaying>',
'<queue>', '<queue>',
], ],
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
switch (args[0]) { switch (args[0]) {
case 'play': case 'play':
play(bot, args.slice(1)); play(bot, args.slice(1), false, null, selector);
break; break;
case 'playurl': case 'playurl':
playUrl(bot, args.slice(1)); playUrl(bot, args.slice(1), false, null, selector);
break; break;
case 'stop': case 'stop':
try { try {
bot.tellraw('@a', {text: 'Cleared the song queue'}); bot.tellraw(selector, {text: 'Cleared the song queue'});
} catch (e) { } catch (e) {
return; return;
} }
@ -161,7 +162,7 @@ module.exports = {
break; break;
case 'skip': case 'skip':
try { try {
bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]); bot.tellraw(selector, [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]);
bot.music.skip(); bot.music.skip();
} catch (e) { } catch (e) {
throw new Error('No music is currently playing!'); throw new Error('No music is currently playing!');
@ -171,7 +172,7 @@ module.exports = {
switch (args[1]) { switch (args[1]) {
case 'off': case 'off':
bot.music.loop = 0; bot.music.loop = 0;
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: 'Looping is now ', text: 'Looping is now ',
}, },
@ -183,7 +184,7 @@ module.exports = {
break; break;
case 'current': case 'current':
bot.music.loop = 1; bot.music.loop = 1;
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: 'Now Looping ', text: 'Now Looping ',
}, },
@ -195,7 +196,7 @@ module.exports = {
break; break;
case 'all': case 'all':
bot.music.loop = 2; bot.music.loop = 2;
bot.tellraw('@a', { bot.tellraw(selector, {
text: 'Now looping every song in the queue', text: 'Now looping every song in the queue',
}); });
break; break;
@ -204,10 +205,10 @@ module.exports = {
} }
break; break;
case 'list': case 'list':
list(bot, false, null, prefix); list(bot, false, null, prefix, selector);
break; break;
case 'nowplaying': case 'nowplaying':
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: 'Now playing ', text: 'Now playing ',
}, },
@ -220,7 +221,7 @@ module.exports = {
case 'queue': case 'queue':
const queueWithName = []; const queueWithName = [];
bot.music.queue.forEach((song) => queueWithName.push(song.name)); bot.music.queue.forEach((song) => queueWithName.push(song.name));
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: 'Queue: ', text: 'Queue: ',
color: 'green', color: 'green',

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Broadcasts a message to all of the servers that the bot is connected', description: 'Broadcasts a message to all of the servers that the bot is connected',
usage: '<message>', usage: '<message>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
const component = [ const component = [
{ {
text: '[', text: '[',
@ -39,7 +39,7 @@ module.exports = {
const bots = bot.getBots(); const bots = bot.getBots();
bots.forEach((bot) => { bots.forEach((bot) => {
bot.tellraw('@a', component); bot.tellraw(selector, component);
}); });
}, },
}; };

View file

@ -4,7 +4,7 @@ module.exports = {
description: 'Resets the bot\'s command core', description: 'Resets the bot\'s command core',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.core.loopPlace(); bot.core.loopPlace();
}, },
discordExecute: function(bot) { discordExecute: function(bot) {

View file

@ -6,9 +6,9 @@ module.exports = {
description: 'Randomly teleports the player', description: 'Randomly teleports the player',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
const rtppos = `${between(20000000, 500000)} 100 ${between(20000000, 500000)}`; const rtppos = `${between(20000000, 500000)} 100 ${between(20000000, 500000)}`;
bot.tellraw('@a', [{text: 'Teleporting ', color: 'white'}, {text: username, color: 'aqua'}, {text: ' to ', color: 'white'}, {text: rtppos, color: 'green'}, {text: '...', color: 'white'}]); bot.tellraw(selector, [{text: 'Teleporting ', color: 'white'}, {text: username, color: 'aqua'}, {text: ' to ', color: 'white'}, {text: rtppos, color: 'green'}, {text: '...', color: 'white'}]);
bot.core.run(`essentials:teleport ${sender} ${rtppos}`); bot.core.run(`essentials:teleport ${sender} ${rtppos}`);
}, },
}; };

View file

@ -7,12 +7,12 @@ module.exports = {
description: 'Eval command without vm2', description: 'Eval command without vm2',
trusted: 2, trusted: 2,
usage: '<ownerhash> <code>', usage: '<ownerhash> <code>',
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === ownerhash) { if (args[0] === ownerhash) {
try { try {
bot.tellraw('@a', {text: `${util.inspect(eval(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 32000)}); bot.tellraw(selector, {text: `${util.inspect(eval(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 32000)});
} catch (err) { } catch (err) {
bot.tellraw('@a', {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'}); bot.tellraw(selector, {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'});
} }
} else { } else {
throw new Error('Invalid OwnerHash'); throw new Error('Invalid OwnerHash');

View file

@ -6,8 +6,8 @@ module.exports = {
description: 'Tests if the bot is working', description: 'Tests if the bot is working',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [ bot.tellraw(selector, [
{ {
text: `Username: ${username},`, text: `Username: ${username},`,
color: 'green', color: 'green',

View file

@ -7,17 +7,17 @@ module.exports = {
description: 'Shows the time', description: 'Shows the time',
usage: '<timezone>', usage: '<timezone>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
const timezone = args.join(' '); const timezone = args.join(' ');
const momented = moment().tz(`${timezone}`).format('dddd, MMMM Do, YYYY, hh:mm:ss A'); const momented = moment().tz(`${timezone}`).format('dddd, MMMM Do, YYYY, hh:mm:ss A');
const component = [{text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}]; const component = [{text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}];
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
bot.tellraw('@a', component); bot.tellraw(selector, component);
return; return;
} else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) { } else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) {
throw new SyntaxError('Invalid timezone'); throw new SyntaxError('Invalid timezone');
} else { } else {
bot.tellraw('@a', component); bot.tellraw(selector, component);
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -5,7 +5,7 @@ module.exports = {
description: 'Teleport everyone', description: 'Teleport everyone',
usage: '<hash> <player>', usage: '<hash> <player>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.core.run(`minecraft:execute unless entity @s[name= run ] run tp @a ${args.slice(1).join(' ')}`); bot.core.run(`minecraft:execute unless entity @s[name= run ] run tp @a ${args.slice(1).join(' ')}`);
} else { } else {

View file

@ -10,9 +10,9 @@ module.exports = {
execute: async function(bot, username, usernameraw, sender, prefix, args) { execute: async function(bot, username, usernameraw, sender, prefix, args) {
try { try {
const res = await translate(args.slice(2).join(' '), {from: args[0], to: args[1]}); const res = await translate(args.slice(2).join(' '), {from: args[0], to: args[1]});
bot.tellraw('@a', [{text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]); bot.tellraw(selector, [{text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]);
} catch (e) { } catch (e) {
bot.tellraw('@a', {text: String(e), color: 'red'}); bot.tellraw(selector, {text: String(e), color: 'red'});
} }
}, },
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {

View file

@ -7,8 +7,8 @@ module.exports = {
description: 'Shows the bot\'s uptime', description: 'Shows the bot\'s uptime',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw('@a', [{text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]); bot.tellraw(selector, [{text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]);
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -6,14 +6,14 @@ module.exports = {
description: 'Working Urban Dictionary', description: 'Working Urban Dictionary',
usage: '<word>', usage: '<word>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
urban.autocompleteExtra(args[0], (error, results) => { urban.autocompleteExtra(args[0], (error, results) => {
if (error) { if (error) {
bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]); bot.tellraw(selector, [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]);
return; return;
} }
results.forEach(({preview, term}) => { results.forEach(({preview, term}) => {
bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]); bot.tellraw(selector, [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]);
}); });
}); });
}, },

View file

@ -6,12 +6,12 @@ module.exports = {
description: 'Gets the UUID of a player. If no player specified it will show your UUID instead', description: 'Gets the UUID of a player. If no player specified it will show your UUID instead',
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0]) { if (args[0]) {
const playername = args.join(' '); const playername = args.join(' ');
const player = bot.playersAddedPlayers[playername]; const player = bot.playersAddedPlayers[playername];
if (player === undefined) throw new SyntaxError('Invalid Username'); if (player === undefined) throw new SyntaxError('Invalid Username');
bot.tellraw('@a', bot.tellraw(selector,
[ [
{ {
text: `${playername}'s UUID: `, text: `${playername}'s UUID: `,
@ -36,7 +36,7 @@ module.exports = {
}, },
]); ]);
} else { } else {
bot.tellraw('@a', bot.tellraw(selector,
[ [
{ {
text: `Your UUID: `, text: `Your UUID: `,

View file

@ -5,13 +5,13 @@ module.exports = {
alias: [], alias: [],
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash) { execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) { if (args[0] === hash) {
bot.tellraw('@a', {text: 'Valid hash', color: 'green'}); bot.tellraw(selector, {text: 'Valid hash', color: 'green'});
} else if (args[0] === ownerhash) { } else if (args[0] === ownerhash) {
bot.tellraw('@a', {text: 'Valid OwnerHash', color: 'green'}); bot.tellraw(selector, {text: 'Valid OwnerHash', color: 'green'});
} else { } else {
bot.tellraw('@a', {text: 'Invalid hash', color: 'red'}); bot.tellraw(selector, {text: 'Invalid hash', color: 'red'});
} }
}, },
}; };

View file

@ -12,9 +12,9 @@ module.exports = {
try { try {
const page = await wiki.page(args.join(' ')); const page = await wiki.page(args.join(' '));
const summary = await page.summary(); const summary = await page.summary();
bot.tellraw('@a', {text: summary.extract, color: 'green'}); bot.tellraw(selector, {text: summary.extract, color: 'green'});
} catch (e) { } catch (e) {
bot.tellraw('@a', {text: e.toString(), color: 'red'}); bot.tellraw(selector, {text: e.toString(), color: 'red'});
} }
}, },
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -11,7 +11,7 @@ function inject(bot, dcclient, config) {
bot.command_handler.commands = loadFiles(path.join(__dirname, config.commandsDir)); bot.command_handler.commands = loadFiles(path.join(__dirname, config.commandsDir));
}; };
bot.command_handler.reload(); bot.command_handler.reload();
bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc, hash, ownerhash) { bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc, hash, ownerhash, selector) {
bot.command_handler.reload(); bot.command_handler.reload();
let raw; let raw;
let command; let command;
@ -28,7 +28,7 @@ function inject(bot, dcclient, config) {
if (typeof command.discordExecute === 'undefined') throw new Error('This command is not yet supported on discord!'); if (typeof command.discordExecute === 'undefined') throw new Error('This command is not yet supported on discord!');
command.discordExecute(bot, username, usernameraw, sender, prefix, args, channeldc, message, config); command.discordExecute(bot, username, usernameraw, sender, prefix, args, channeldc, message, config);
} else { } else {
command.execute(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash); command.execute(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector);
} }
} catch (e) { } catch (e) {
if (prefix === config.discord.prefix) { if (prefix === config.discord.prefix) {
@ -42,10 +42,10 @@ function inject(bot, dcclient, config) {
} }
} }
}; };
bot.command_handler.run = function(username, usernameraw, message, sender, channeldc, hash, ownerhash) { bot.command_handler.run = function(username, usernameraw, message, sender, channeldc, hash, ownerhash, selector = '@a') {
for (const prefix of config.prefixes) { for (const prefix of config.prefixes) {
if (!message.startsWith(prefix)) continue; if (!message.startsWith(prefix)) continue;
bot.command_handler.main(prefix, username, usernameraw, message, sender, channeldc, hash, ownerhash); bot.command_handler.main(prefix, username, usernameraw, message, sender, channeldc, hash, ownerhash, selector);
} }
}; };
bot.on('message', async (_username, _message, _sender) => { bot.on('message', async (_username, _message, _sender) => {

View file

@ -1,3 +1,4 @@
/* eslint-disable require-jsdoc */
/* eslint-disable max-len */ /* eslint-disable max-len */
const {escapeMarkdown} = require('../util/escapeMarkdown'); const {escapeMarkdown} = require('../util/escapeMarkdown');
async function inject(bot, dcclient, config, rl) { async function inject(bot, dcclient, config, rl) {

View file

@ -1,7 +1,14 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
const convert = require('color-convert'); const convert = require('color-convert');
// eslint-disable-next-line require-jsdoc
function inject(bot) { function inject(bot) {
/**
* draw which is totallynotskidded from ybot
* @param {buffer} data data buffer
* @param {*} info idk bout this
* @param {object} prefix prefix in the output compoenent
*/
function draw(data, info, prefix = {}) { function draw(data, info, prefix = {}) {
const pixels = []; const pixels = [];

View file

@ -1,3 +1,4 @@
/* eslint-disable require-jsdoc */
/* eslint-disable max-len */ /* eslint-disable max-len */
const {Midi} = require('@tonejs/midi'); const {Midi} = require('@tonejs/midi');
const {convertMidi} = require('../util/midi_converter'); const {convertMidi} = require('../util/midi_converter');

View file

@ -62,6 +62,7 @@ function inject(bot, dcclient, config) {
null, null,
'h', 'h',
'o', 'o',
client.username,
); );
} }
bot.tellraw('@a', { bot.tellraw('@a', {