mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
usage fix and improve and real and real real
This commit is contained in:
parent
be8908ab6e
commit
738d5472e0
6 changed files with 30 additions and 11 deletions
|
@ -58,7 +58,12 @@ module.exports = {
|
|||
name: 'cloop',
|
||||
alias: [],
|
||||
description: 'Loop commands',
|
||||
usage: '<hash> <add|remove|removeall|list> <interval|index> <command>',
|
||||
usage: [
|
||||
'<hash> <add> <interval> <command>',
|
||||
'<hash> <remove> <index>',
|
||||
'<hash> <removeall>',
|
||||
'<hash> <list>',
|
||||
],
|
||||
trusted: 1,
|
||||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||
if (!bot.cloops) bot.cloops = [];
|
||||
|
|
|
@ -10,7 +10,11 @@ module.exports = {
|
|||
alias: [],
|
||||
description: 'Safe eval 100% secure!!!',
|
||||
trusted: 0,
|
||||
usage: '<run|reset|server> <code>',
|
||||
usage: [
|
||||
'<run> <code>',
|
||||
'<reset>',
|
||||
'<server (eval server)> code',
|
||||
],
|
||||
execute: function(bot, username, usernameraw, sender, prefix, args, config) {
|
||||
if (args[0] === 'run') {
|
||||
try {
|
||||
|
|
|
@ -61,8 +61,10 @@ module.exports = {
|
|||
} else {
|
||||
command.usage.forEach((value) => {
|
||||
usage.push({text: `${prefix}${command.name} `, color: 'gold'});
|
||||
usage.push({text: `${value}\n`, color: 'aqua'});
|
||||
usage.push({text: value, color: 'aqua'});
|
||||
usage.push('\n');
|
||||
});
|
||||
usage.pop();
|
||||
}
|
||||
|
||||
bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]);
|
||||
|
|
|
@ -133,7 +133,16 @@ module.exports = {
|
|||
description: 'Plays music',
|
||||
alias: [],
|
||||
trusted: 0,
|
||||
usage: '<play|playurl|stop|loop|list|skip|loop|nowplaying|queue> <song|all|current|off>',
|
||||
usage: [
|
||||
'<play> <song>',
|
||||
'<playurl> <url>',
|
||||
'<stop>',
|
||||
'<loop> <all|current|off>',
|
||||
'<list>',
|
||||
'<skip>',
|
||||
'<nowplaying>',
|
||||
'<queue>',
|
||||
],
|
||||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||
switch (args[0]) {
|
||||
case 'play':
|
||||
|
|
|
@ -6,7 +6,7 @@ module.exports = {
|
|||
name: 'wikipedia',
|
||||
alias: ['wiki'],
|
||||
description: 'Working Wikipedia!',
|
||||
usage: '<anything>',
|
||||
usage: '<page>',
|
||||
trusted: 0,
|
||||
execute: async function(bot, username, usernameraw, sender, prefix, args) {
|
||||
try {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/* eslint-disable max-len */
|
||||
const loadFiles = require('../util/load_files');
|
||||
const path = require('path');
|
||||
const {MessageEmbed} = require('discord.js');
|
||||
function inject(bot, dcclient, config) {
|
||||
const loadFiles = require('../util/load_files');
|
||||
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.options.host]);
|
||||
bot.command_handler = {};
|
||||
bot.command_handler.commands = {};
|
||||
function reload() {
|
||||
bot.command_handler.reload = function() {
|
||||
bot.command_handler.commands = loadFiles(path.join(__dirname, config.commandsDir));
|
||||
}
|
||||
reload();
|
||||
};
|
||||
bot.command_handler.reload();
|
||||
bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc) {
|
||||
reload();
|
||||
bot.command_handler.reload();
|
||||
let raw;
|
||||
let command;
|
||||
message.content ? raw = message.content.substring(prefix.length) : raw = message.substring(prefix.length);
|
||||
|
@ -48,7 +48,6 @@ function inject(bot, dcclient, config) {
|
|||
}
|
||||
};
|
||||
bot.on('message', async (usernamee, messagee, senderr) => {
|
||||
console.log()
|
||||
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
|
||||
try {
|
||||
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
|
||||
|
|
Loading…
Reference in a new issue