mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54: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',
|
name: 'cloop',
|
||||||
alias: [],
|
alias: [],
|
||||||
description: 'Loop commands',
|
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,
|
trusted: 1,
|
||||||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||||
if (!bot.cloops) bot.cloops = [];
|
if (!bot.cloops) bot.cloops = [];
|
||||||
|
|
|
@ -10,7 +10,11 @@ module.exports = {
|
||||||
alias: [],
|
alias: [],
|
||||||
description: 'Safe eval 100% secure!!!',
|
description: 'Safe eval 100% secure!!!',
|
||||||
trusted: 0,
|
trusted: 0,
|
||||||
usage: '<run|reset|server> <code>',
|
usage: [
|
||||||
|
'<run> <code>',
|
||||||
|
'<reset>',
|
||||||
|
'<server (eval server)> code',
|
||||||
|
],
|
||||||
execute: function(bot, username, usernameraw, sender, prefix, args, config) {
|
execute: function(bot, username, usernameraw, sender, prefix, args, config) {
|
||||||
if (args[0] === 'run') {
|
if (args[0] === 'run') {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -61,8 +61,10 @@ module.exports = {
|
||||||
} else {
|
} else {
|
||||||
command.usage.forEach((value) => {
|
command.usage.forEach((value) => {
|
||||||
usage.push({text: `${prefix}${command.name} `, color: 'gold'});
|
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'}]);
|
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',
|
description: 'Plays music',
|
||||||
alias: [],
|
alias: [],
|
||||||
trusted: 0,
|
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) {
|
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||||
switch (args[0]) {
|
switch (args[0]) {
|
||||||
case 'play':
|
case 'play':
|
||||||
|
|
|
@ -6,7 +6,7 @@ module.exports = {
|
||||||
name: 'wikipedia',
|
name: 'wikipedia',
|
||||||
alias: ['wiki'],
|
alias: ['wiki'],
|
||||||
description: 'Working Wikipedia!',
|
description: 'Working Wikipedia!',
|
||||||
usage: '<anything>',
|
usage: '<page>',
|
||||||
trusted: 0,
|
trusted: 0,
|
||||||
execute: async function(bot, username, usernameraw, sender, prefix, args) {
|
execute: async function(bot, username, usernameraw, sender, prefix, args) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
const loadFiles = require('../util/load_files');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {MessageEmbed} = require('discord.js');
|
const {MessageEmbed} = require('discord.js');
|
||||||
function inject(bot, dcclient, config) {
|
function inject(bot, dcclient, config) {
|
||||||
|
const loadFiles = require('../util/load_files');
|
||||||
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.options.host]);
|
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.options.host]);
|
||||||
bot.command_handler = {};
|
bot.command_handler = {};
|
||||||
bot.command_handler.commands = {};
|
bot.command_handler.commands = {};
|
||||||
function reload() {
|
bot.command_handler.reload = function() {
|
||||||
bot.command_handler.commands = loadFiles(path.join(__dirname, config.commandsDir));
|
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) {
|
bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc) {
|
||||||
reload();
|
bot.command_handler.reload();
|
||||||
let raw;
|
let raw;
|
||||||
let command;
|
let command;
|
||||||
message.content ? raw = message.content.substring(prefix.length) : raw = message.substring(prefix.length);
|
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) => {
|
bot.on('message', async (usernamee, messagee, senderr) => {
|
||||||
console.log()
|
|
||||||
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
|
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
|
||||||
try {
|
try {
|
||||||
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
|
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
|
||||||
|
|
Loading…
Reference in a new issue