mirror of
https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot.git
synced 2024-11-14 19:34:59 -05:00
Compare commits
No commits in common. "ab87e748f9d26ac77cbaf6de6fbdbed8355c4ec5" and "ac2f59d14ddea69165143c06ec7c4b2afc276f10" have entirely different histories.
ab87e748f9
...
ac2f59d14d
34 changed files with 484 additions and 578 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "FridayNightFunkinBoyfriendBot",
|
||||
"version": "v6.1.0",
|
||||
"version": "v6.0.9-1",
|
||||
"build": "1115",
|
||||
"url": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot",
|
||||
"codename": "",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"build": "1130",
|
||||
"codename": "",
|
||||
"url": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot",
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'vanish',
|
||||
trustLevel: 2,
|
||||
aliases: [
|
||||
"vanishtoggle"
|
||||
],
|
||||
description: 'toggle the bots vanish selfcare',
|
||||
usages: [
|
||||
|
||||
],
|
||||
},
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
||||
if (args.slice(1).join('') === 'true') {
|
||||
bot.vanished = true
|
||||
bot.chat.message('enabled vanish selfcare')
|
||||
}
|
||||
if (args.slice(1).join('') === 'false') {
|
||||
bot.vanished = false;
|
||||
bot.chat.message('disabled vanish selfcare')
|
||||
}
|
||||
},
|
||||
discordExecute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.vanished = false;
|
||||
bot.chat.message('disabling vanish selfcare,...');
|
||||
bot.chat.command('v off')
|
||||
}
|
||||
}
|
|
@ -1,18 +1,12 @@
|
|||
const bots = require('../../data/bots.json');
|
||||
const CommandError = require('../../util/command_error')
|
||||
const bots = require('../data/bots.json');
|
||||
const CommandError = require('../util/command_error')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: "bots",
|
||||
description: "shows a list of known bots",
|
||||
aliases: [
|
||||
"knownbots"
|
||||
],
|
||||
trustLevel: 0,
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
async execute(context) {
|
||||
name: "bots",
|
||||
description: "shows a list of known bots",
|
||||
aliases: ["knownbots"],
|
||||
trustLevel: 0,
|
||||
usages:[""],
|
||||
async execute(context) {
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
const bot = context.bot;
|
||||
if (query.length === 0) {
|
|
@ -1,20 +1,18 @@
|
|||
const { EmbedBuilder } = require('discord.js');
|
||||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'cloop',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"commandloop"
|
||||
],
|
||||
description: 'run cloops',
|
||||
usages: [
|
||||
"add <interval> <command>",
|
||||
"remove <index>",
|
||||
"clear",
|
||||
"list",
|
||||
],
|
||||
},
|
||||
name: 'cloop',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"commandloop"
|
||||
],
|
||||
description: 'run cloops',
|
||||
usages: [
|
||||
"add <interval> <command>",
|
||||
"remove <index>",
|
||||
"clear",
|
||||
"list",
|
||||
],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
|
@ -1,19 +1,16 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'console',
|
||||
trustLevel: 4,
|
||||
description: "",
|
||||
aliases: [
|
||||
name: 'console',
|
||||
trustLevel: 4,
|
||||
aliases: [
|
||||
|
||||
],
|
||||
usages: [
|
||||
'server/srv <all/servername>',
|
||||
'customchat <on/true/enable/off/false/disable>',
|
||||
'say <message>',
|
||||
'validate/validation/val <owner/o/admin/a/trusted/t>',
|
||||
'logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>'
|
||||
],
|
||||
},
|
||||
],
|
||||
usages: [
|
||||
'server/srv <all/servername>',
|
||||
'customchat <on/true/enable/off/false/disable>',
|
||||
'say <message>',
|
||||
'validate/validation/val <owner/o/admin/a/trusted/t>',
|
||||
'logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>'
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
|
@ -1,19 +1,17 @@
|
|||
const CommandError = require('../../util/command_error')
|
||||
const CommandError = require('../util/command_error')
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'core',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"cb",
|
||||
"corerun",
|
||||
"commandcorerun",
|
||||
],
|
||||
description: 'run commands in core!',
|
||||
usages: [
|
||||
"<command>",
|
||||
],
|
||||
},
|
||||
name: 'core',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"cb",
|
||||
"corerun",
|
||||
"commandcorerun",
|
||||
],
|
||||
description: 'run commands in core!',
|
||||
usages: [
|
||||
"<command>",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ');
|
|
@ -1,19 +1,17 @@
|
|||
const cowsay = require('cowsay2');
|
||||
const cows = require('cowsay2/cows');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const fixansi = require('../../util/ansi');
|
||||
const fixansi = require('../util/ansi');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'cowsay',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'cows',
|
||||
usages: [
|
||||
"<message>",
|
||||
"list"
|
||||
],
|
||||
},
|
||||
name: 'cowsay',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'cows',
|
||||
usages: [
|
||||
"<message>",
|
||||
"list"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
|
@ -1,16 +1,14 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'echo',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"say",
|
||||
"botsay",
|
||||
],
|
||||
description: 'Make me say something',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
},
|
||||
name: 'echo',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"say",
|
||||
"botsay",
|
||||
],
|
||||
description: 'Make me say something',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
@ -18,15 +16,20 @@ module.exports = {
|
|||
bot.chat.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
|
||||
// if
|
||||
bot.chat.message(message)
|
||||
},
|
||||
discordExecute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
// const interaction = context.interaction
|
||||
//interaction.options.getString('input')
|
||||
if (args.join(' ').startsWith('/')) {
|
||||
bot.chat.command(args.join(' ').substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat.message(args.join(' '))
|
||||
// bot.chat.message('e')
|
||||
}
|
||||
}
|
|
@ -1,21 +1,19 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'filter',
|
||||
trustLevel: 2,
|
||||
aliases: [
|
||||
"blacklist"
|
||||
],
|
||||
description: 'filters players',
|
||||
usages: [
|
||||
"list",
|
||||
"--regex(-r) --ignorecase(-i) add <player>",
|
||||
"--ignorecase(-i) add <player>",
|
||||
"add <player>",
|
||||
"clear",
|
||||
"remove(rm) <index>"
|
||||
],
|
||||
},
|
||||
name: 'filter',
|
||||
trustLevel: 2,
|
||||
aliases: [
|
||||
"blacklist"
|
||||
],
|
||||
description: 'filters players',
|
||||
usages: [
|
||||
"list",
|
||||
"--regex(-r) --ignorecase(-i) add <player>",
|
||||
"--ignorecase(-i) add <player>",
|
||||
"add <player>",
|
||||
"clear",
|
||||
"remove(rm) <index>"
|
||||
],
|
||||
execute (context) {
|
||||
/*
|
||||
note:
|
|
@ -1,27 +1,26 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const sleep = require('../../util/sleep.js');
|
||||
const fixansi = require('../../util/ansi');
|
||||
const CommandError = require('../util/command_error');
|
||||
const sleep = require('../util/sleep.js');
|
||||
const fixansi = require('../util/ansi');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'help',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"heko",
|
||||
"?",
|
||||
"cmds",
|
||||
"hell",
|
||||
"hello",
|
||||
"helo",
|
||||
"commands",
|
||||
"commandshelp",
|
||||
],
|
||||
description: 'a list of the bots commands',
|
||||
usages: [
|
||||
"",
|
||||
"<command>",
|
||||
],
|
||||
},
|
||||
name: 'help',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"heko",
|
||||
"?",
|
||||
"cmds",
|
||||
"hell",
|
||||
"hello",
|
||||
"helo",
|
||||
"commands",
|
||||
"commandshelp",
|
||||
|
||||
],
|
||||
description: 'a list of the bots commands',
|
||||
usages: [
|
||||
"",
|
||||
"<command>",
|
||||
],
|
||||
execute (context) {
|
||||
const commandList = [];
|
||||
const bot = context.bot;
|
||||
|
@ -48,41 +47,41 @@ module.exports = {
|
|||
for (const command of bot.commandManager.commandlist) {
|
||||
let usagesComponent = [];
|
||||
let commandComponent = [];
|
||||
for (const usages of command.data.usages) {
|
||||
if (command?.data?.trustLevel === 1) {
|
||||
for (const usages of command.usages) {
|
||||
if (command?.trustLevel === 1) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
|
||||
{ text: `${command.data.name} <trusted/admin/owner hashes>`, color: "blue" },
|
||||
{ text: `${command.name} <trusted/admin/owner hashes>`, color: "blue" },
|
||||
{ text: `${usages}`, color: "aqua" },
|
||||
]
|
||||
})
|
||||
} else if (command?.data.trustLevel === 2) {
|
||||
} else if (command?.trustLevel === 2) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
|
||||
{ text: `${command.data.name} <admin/owner hashes>`, color: "blue" },
|
||||
{ text: `${command.name} <admin/owner hashes>`, color: "blue" },
|
||||
{ text: `${usages}`, color: "aqua" },
|
||||
]
|
||||
})
|
||||
} else if (command?.data.trustLevel === 3) {
|
||||
} else if (command?.trustLevel === 3) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
|
||||
{ text: `${command.data.name} <owner hash>`, color: "blue" },
|
||||
{ text: `${command.name} <owner hash>`, color: "blue" },
|
||||
{ text: `${usages}`, color: "aqua" },
|
||||
]
|
||||
})
|
||||
} else if (command?.data.trustLevel === 0 || command.data.trustLevel === 4) {
|
||||
} else if (command?.trustLevel === 0 || command.trustLevel === 4) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
|
||||
{ text: `${command.data.name}`, color: "blue" },
|
||||
{ text: `${usages}`, color: "aqua" },
|
||||
{ text: `${command.name}`, color: "blue" },
|
||||
{ text: `${usages.toString().replaceAll(',','')}`, color: "aqua" },
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -95,16 +94,16 @@ module.exports = {
|
|||
with: [
|
||||
{ text: "Command Name", color: "dark_blue" },
|
||||
{ text: "\u203a" },
|
||||
{ text: `${command.data.name}`, color: "blue" },
|
||||
{ text: `${command.name}`, color: "blue" },
|
||||
{ text: "Aliases", color: "dark_blue" },
|
||||
{ text: "\u203a" },
|
||||
{ text: `${command.data.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
|
||||
{ text: `${command.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
|
||||
{ text: "Description", color: "dark_blue" },
|
||||
{ text: "\u203a" },
|
||||
{ text: `${command.data.description}`, color: "blue" },
|
||||
{ text: `${command.description}`, color: "blue" },
|
||||
{ text: "Trust Level", color: "dark_blue" },
|
||||
{ text: "\u203a" },
|
||||
{ text: `${command.data.trustLevel}`, color: "gold" },
|
||||
{ text: `${command.trustLevel}`, color: "gold" },
|
||||
{ text: "Usages", color: "dark_blue" },
|
||||
{ text: "\u203a" }
|
||||
]
|
||||
|
@ -112,7 +111,7 @@ module.exports = {
|
|||
commandComponent.push("\n");
|
||||
commandComponent.push(usagesComponent);
|
||||
// for (const aliases of command.aliases) {
|
||||
if (args[0]?.toLowerCase() === command.data.name) {
|
||||
if (args[0]?.toLowerCase() === command.name) {
|
||||
if (bot.options.isSavage) {
|
||||
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`);
|
||||
} else {
|
||||
|
@ -131,17 +130,17 @@ module.exports = {
|
|||
console.log(aliases)*/
|
||||
// }
|
||||
// tellraw @p {"text":"this","clickEvent":{"action":"suggest_command","value":"this"}}
|
||||
if (command.data.trustLevel === 0) {
|
||||
if (command.trustLevel === 0) {
|
||||
public.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "aqua",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Command: ${command.data.name}\n`,
|
||||
text: `Command: ${command.name}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -149,15 +148,15 @@ module.exports = {
|
|||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `${command.data.trustLevel}\n`,
|
||||
text: `${command.trustLevel}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `${command.data.description}\n`,
|
||||
text: `${command.description}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `Command Aliases: ${command.data.aliases}\n`,
|
||||
text: `Command Aliases: ${command.aliases}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -168,21 +167,21 @@ module.exports = {
|
|||
},
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${config.prefixes[0]}${command?.data.name}`
|
||||
value: `${config.prefixes[0]}${command?.name}`
|
||||
}
|
||||
}
|
||||
])
|
||||
} else if (command.data.trustLevel === 1) {
|
||||
} else if (command.trustLevel === 1) {
|
||||
trusted.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "dark_aqua",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Command: ${command.data.name}\n`,
|
||||
text: `Command:${command.name}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -190,15 +189,15 @@ module.exports = {
|
|||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `${command.data.trustLevel}\n`,
|
||||
text: `${command.trustLevel}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `${command.data.description}\n`,
|
||||
text: `${command.description}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `Command Aliases: ${command.data.aliases}\n`,
|
||||
text: `Command Aliases: ${command.aliases}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -209,21 +208,21 @@ module.exports = {
|
|||
},
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${config.prefixes[0]}${command?.data.name}`
|
||||
value: `${config.prefixes[0]}${command?.name}`
|
||||
}
|
||||
}
|
||||
])
|
||||
} else if (command.data.trustLevel === 2) {
|
||||
} else if (command.trustLevel === 2) {
|
||||
admin.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "blue",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action:"show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Command: ${command.data.name}\n`,
|
||||
text: `Command:${command.name}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -231,15 +230,15 @@ module.exports = {
|
|||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `${command.data.trustLevel}\n`,
|
||||
text: `${command.trustLevel}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `${command.data.description}\n`,
|
||||
text: `${command.description}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `Command Aliases: ${command.data.aliases}\n`,
|
||||
text: `Command Aliases: ${command.aliases}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -250,21 +249,21 @@ module.exports = {
|
|||
},
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${config.prefixes[0]}${command?.data.name}`
|
||||
value: `${config.prefixes[0]}${command?.name}`
|
||||
}
|
||||
}
|
||||
])
|
||||
} else if (command.data.trustLevel === 3) {
|
||||
} else if (command.trustLevel === 3) {
|
||||
owner.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "dark_blue",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Command: ${command.data.name}\n`,
|
||||
text: `Command:${command.name}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -272,15 +271,15 @@ module.exports = {
|
|||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `${command.data.trustLevel}\n`,
|
||||
text: `${command.trustLevel}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `${command.data.description}\n`,
|
||||
text: `${command.description}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
text: `Command Aliases: ${command.data.aliases}\n`,
|
||||
text: `Command Aliases: ${command.aliases}\n`,
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
|
@ -291,13 +290,13 @@ module.exports = {
|
|||
},
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${config.prefixes[0]}${command?.data.name}`
|
||||
value: `${config.prefixes[0]}${command?.name}`
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
const length = bot.commandManager.commandlist.filter(c => c.data.trustLevel != 4).length
|
||||
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 4).length
|
||||
if (bot.options.useChat) {
|
||||
bot.chat.message(bot.getMessageAsPrismarine([
|
||||
{
|
||||
|
@ -401,52 +400,52 @@ module.exports = {
|
|||
let admin = [];
|
||||
let owner = [];
|
||||
for (const command of bot.commandManager.commandlist) {
|
||||
if (args[0] === command.data.name) {
|
||||
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.data.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.data.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.data.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.data.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.data.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
|
||||
if (args[0] === command.name) {
|
||||
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
|
||||
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor(`${config.colors.discord.embed}`)
|
||||
.setTitle(`${this.data.name} Command`)
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
|
||||
bot.discord.message.reply({ embeds: [Embed] })
|
||||
return
|
||||
}
|
||||
if (command?.data.trustLevel === 0 && command.discordExecute) {
|
||||
if (command?.trustLevel === 0 && command.discordExecute) {
|
||||
public.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "aqua",
|
||||
}
|
||||
])
|
||||
} else if (command?.data.trustLevel === 1 && command.discordExecute) {
|
||||
} else if (command?.trustLevel === 1 && command.discordExecute) {
|
||||
trusted.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "dark_aqua"
|
||||
}
|
||||
])
|
||||
} else if (command?.data.trustLevel === 2 && command.discordExecute) {
|
||||
} else if (command?.trustLevel === 2 && command.discordExecute) {
|
||||
admin.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: 'blue'
|
||||
}
|
||||
])
|
||||
} else if (command?.data.trustLevel === 3 && command.discordExecute) {
|
||||
} else if (command?.trustLevel === 3 && command.discordExecute) {
|
||||
owner.push([
|
||||
{
|
||||
text: command.data.name + ' ',
|
||||
text: command.name + ' ',
|
||||
color: "dark_blue",
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
const length = bot.commandManager.commandlist.filter(c => c.data.trustLevel !== 4 && c.discordExecute).length
|
||||
const length = bot.commandManager.commandlist.filter(c => c.trustLevel !== 3 && c.discordExecute).length
|
||||
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
|
||||
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor(`${config.colors.discord.embed}`)
|
||||
.setTitle(`${this.data.name} Command`)
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
|
||||
bot.discord.message.reply({ embeds: [Embed] })
|
||||
bot?.discord?.message.react('♋')
|
|
@ -1,8 +1,8 @@
|
|||
const os = require("os");
|
||||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
const fs = require("fs");
|
||||
const botInfo = require('../../../package-lock.json');
|
||||
const fixansi = require('../../util/ansi.js');
|
||||
const botInfo = require('../../package-lock.json');
|
||||
const fixansi = require('../util/ansi.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const { exec } = require('child_process')
|
||||
function format(seconds) {
|
||||
|
@ -18,22 +18,20 @@ function format(seconds) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'info',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"information",
|
||||
],
|
||||
description: 'check the bots info',
|
||||
usages: [
|
||||
"version",
|
||||
"config",
|
||||
"discord",
|
||||
"server",
|
||||
"contributors",
|
||||
"about"
|
||||
],
|
||||
},
|
||||
name: 'info',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"information",
|
||||
],
|
||||
description: 'check the bots info',
|
||||
usages: [
|
||||
"version",
|
||||
"config",
|
||||
"discord",
|
||||
"server",
|
||||
"contributors",
|
||||
"about"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
|
@ -66,62 +64,74 @@ module.exports = {
|
|||
mode = 'Savage'
|
||||
}
|
||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
|
||||
{
|
||||
text: `Minecraft username \u203a ${bot.options.username}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Ip \u203a ${bot.options.host}:`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${bot.options.port}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `Version \u203a ${bot.options.version}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Discord username \u203a ${discordClient.user.tag}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Channel \u203a ${bot.discord.channel?.name}\n`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `Server name \u203a ${bot.options.serverName}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Server count \u203a `,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${bot.bots.length}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `Prefix Length: `,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${config.prefixes.length}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: 'Mode \u203a ',
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `${mode}`,
|
||||
color: 'gray',
|
||||
}
|
||||
{
|
||||
text: `Minecraft username \u203a ${bot.options.username}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Ip \u203a ${bot.options.host}:`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${bot.options.port}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `Version \u203a ${bot.options.version}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Discord username \u203a ${discordClient.user.tag}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Channel \u203a ${bot.discord.channel?.name}\n`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `Server name \u203a ${bot.options.serverName}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Server count \u203a `,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${bot.bots.length}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `Prefix Length: `,
|
||||
color: "gray"
|
||||
},
|
||||
{
|
||||
text: `${config.prefixes.length}\n`,
|
||||
color: 'gold'
|
||||
},
|
||||
{
|
||||
text: 'Mode \u203a ',
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `${mode}`,
|
||||
color: 'gray',
|
||||
}
|
||||
/* {
|
||||
text: `isKaboom \u203a ${bot.options.isKaboom}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `isCreayun \u203a ${bot.options.isCreayun}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `isSavage \u203a ${bot.options.isSavage}`,
|
||||
color: "gray",
|
||||
},*/
|
||||
]);
|
||||
break;
|
||||
case 'discord':
|
||||
|
@ -148,7 +158,7 @@ module.exports = {
|
|||
break
|
||||
case "server":
|
||||
if (process.platform === 'win32') {
|
||||
exec('rmdir /s /q ..\\FridayNightFunkinBoyfriendBot')
|
||||
exec('rmdir /s /q ..\FridayNightFunkinBoyfriendBot')
|
||||
process.exit(0) // fuck you windows
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
|
|
@ -1,17 +1,14 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'kick',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
],
|
||||
description: 'kick or crash players',
|
||||
usages: [
|
||||
"invalidstring <player>",
|
||||
"item <player>"
|
||||
],
|
||||
},
|
||||
name: 'kick',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
],
|
||||
description: 'kick or crash players',
|
||||
usages: [
|
||||
"invalidstring <player>",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
|
@ -1,16 +1,14 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'kill',
|
||||
trustLevel: 3,
|
||||
aliases: [
|
||||
"suicide",
|
||||
"quit",
|
||||
],
|
||||
description: 'kill the bots process',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
name: 'kill',
|
||||
trustLevel: 3,
|
||||
aliases: [
|
||||
"suicide",
|
||||
"quit",
|
||||
],
|
||||
description: 'kill the bots process',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
process.kill(process.pid);
|
|
@ -1,20 +1,12 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const fixansi = require('../../util/ansi');
|
||||
const fixansi = require('../util/ansi');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'list',
|
||||
description: 'check the player list',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
'playerlist',
|
||||
'plist',
|
||||
'pl'
|
||||
],
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
name: 'list',
|
||||
description:'check the player list',
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
usages:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
|
@ -1,20 +1,18 @@
|
|||
const { request } = require('undici');
|
||||
const CommandError = require('../../util/command_error.js');
|
||||
const CommandError = require('../util/command_error.js');
|
||||
const mc = require('minecraft-protocol');
|
||||
const util = require('util')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'mcserver',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"pingserver",
|
||||
"pingsrv",
|
||||
],
|
||||
description: 'look up minecraft server info',
|
||||
usages: [
|
||||
"<minecraft server ip>",
|
||||
],
|
||||
},
|
||||
name: 'mcserver',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"pingserver",
|
||||
"pingsrv",
|
||||
],
|
||||
description: 'look up minecraft server info',
|
||||
usages: [
|
||||
"<minecraft server ip>",
|
||||
],
|
||||
async execute (context) {
|
||||
const bot = context.bot;
|
||||
const discordClient = context.discordClient;
|
|
@ -1,16 +1,14 @@
|
|||
const CommandError = require('../../util/command_error.js')
|
||||
const CommandError = require('../util/command_error.js')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'netmsg',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
name: 'netmsg',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
|
||||
],
|
||||
description: 'netmsg to other servers',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
},
|
||||
],
|
||||
description: 'netmsg to other servers',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
execute (context) {
|
||||
const args = context.arguments;
|
||||
const bot = context.bot;
|
|
@ -1,16 +1,14 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'reconnect',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"end",
|
||||
"recon",
|
||||
],
|
||||
description: 'reconnect the bot',
|
||||
usages: [
|
||||
name: 'reconnect',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"end",
|
||||
"recon",
|
||||
],
|
||||
description: 'reconnect the bot',
|
||||
usages: [
|
||||
|
||||
],
|
||||
},
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
|
@ -1,16 +1,14 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: 'refillcore',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"rc",
|
||||
"refill",
|
||||
],
|
||||
description: 'refill the bots core',
|
||||
usages: [
|
||||
name: 'refillcore',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"rc",
|
||||
"refill",
|
||||
],
|
||||
description: 'refill the bots core',
|
||||
usages: [
|
||||
|
||||
],
|
||||
},
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
bot.core.refill()
|
|
@ -1,23 +1,17 @@
|
|||
const between = require('../../util/between')
|
||||
const CommandError = require('../../util/command_error')
|
||||
const between = require('../util/between')
|
||||
const CommandError = require('../util/command_error')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'tpr',
|
||||
description: 'teleport to a random place',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
'rtp',
|
||||
'teleportrandom',
|
||||
'randomteleport'
|
||||
],
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
name: 'tpr',
|
||||
description:'teleport to a random place',
|
||||
trustLevel: 1,
|
||||
aliases:['rtp', 'teleportrandom', 'randomteleport'],
|
||||
usages:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const sender = context.source.player
|
||||
const args = context.arguments;
|
||||
const source = context.source
|
||||
// if (!source.player) return
|
||||
if (bot.options.isKaboom) {
|
||||
x = between(-30_000_000, 30_000_000)
|
||||
y = 100
|
||||
|
@ -27,6 +21,8 @@ module.exports = {
|
|||
y = 100
|
||||
z = between(-4096, 4096);
|
||||
}
|
||||
// bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
// bot.core.run(`minecraft:tp ${sender.profile.name} ${x} ${y} ${z}`)
|
||||
if (args.slice(1).join(' ')) {
|
||||
bot.tellraw("@a", [
|
||||
{ text: 'Randomly Teleported: ', color: 'gray' },
|
|
@ -1,17 +1,15 @@
|
|||
const CommandError = require('../../util/command_error.js');
|
||||
const { stylize } = require('../../util/stylizeEval');
|
||||
const CommandError = require('../util/command_error.js');
|
||||
const { stylize } = require('../util/stylizeEval');
|
||||
const util = require('util');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'servereval',
|
||||
trustLevel: 3,
|
||||
aliases: [
|
||||
],
|
||||
description: 'run code unisolated',
|
||||
usages: [
|
||||
"<code>",
|
||||
],
|
||||
},
|
||||
name: 'servereval',
|
||||
trustLevel: 3,
|
||||
aliases: [
|
||||
],
|
||||
description: 'run code unisolated',
|
||||
usages: [
|
||||
"<code>",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
|
@ -25,7 +23,7 @@ module.exports = {
|
|||
} else if (bot.options.useChat || bot.options.isSavage) {
|
||||
bot.chat.message(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.tellraw(`@a`, [
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
|
||||
{
|
||||
text: util.inspect(eval(script), { stylize }).substring(0, 32700),
|
||||
hoverEvent: {
|
|
@ -1,17 +1,15 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'test',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'Make me say something',
|
||||
usages: [
|
||||
"error stack <message>",
|
||||
"error message <message>",
|
||||
"message <message>"
|
||||
],
|
||||
},
|
||||
name: 'test',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'Make me say something',
|
||||
usages: [
|
||||
"error stack <message>",
|
||||
"error message <message>",
|
||||
"message <message>"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
||||
|
@ -26,6 +24,7 @@ module.exports = {
|
|||
throw new CommandError(args.slice(2).join(' '));
|
||||
break
|
||||
}
|
||||
// throw new Error(args.slice(1).join(' '));
|
||||
break;
|
||||
case "message":
|
||||
bot.tellraw("@a", [
|
|
@ -1,18 +1,14 @@
|
|||
const CommandError = require('../../util/command_error')
|
||||
const CommandError = require('../util/command_error')
|
||||
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, SlashCommandBuilder } = require('discord.js');
|
||||
const { request } = require('undici');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'urban',
|
||||
description: 'urban dictionary',
|
||||
aliases: [
|
||||
'urbandictionary'
|
||||
],
|
||||
trustLevel: 0,
|
||||
usages: [
|
||||
"<definition>",
|
||||
],
|
||||
},
|
||||
name: 'urban',
|
||||
description:'urban dictionary',
|
||||
aliases:['urbandictionary'],
|
||||
trustLevel: 0,
|
||||
usages: [
|
||||
"<definition>",
|
||||
],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
|
@ -1,16 +1,14 @@
|
|||
const { EmbedBuilder } = require('discord.js');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'validate',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"val"
|
||||
],
|
||||
description: 'validate through the bot',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
name: 'validate',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
"val"
|
||||
],
|
||||
description: 'validate through the bot',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
31
src/commands/vanish.js
Normal file
31
src/commands/vanish.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
module.exports = {
|
||||
name: 'vanish',
|
||||
trustLevel: 2,
|
||||
aliases: [
|
||||
"vanishtoggle"
|
||||
],
|
||||
description: 'toggle the bots vanish selfcare',
|
||||
usages: [
|
||||
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
||||
if (args.slice(1).join('') === 'true') {
|
||||
bot.vanished = true
|
||||
bot.chat.message('enabled vanish selfcare')
|
||||
}
|
||||
if (args.slice(1).join('') === 'false') {
|
||||
bot.vanished = false;
|
||||
bot.chat.message('disabled vanish selfcare')
|
||||
}
|
||||
},
|
||||
discordExecute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.vanished = false;
|
||||
bot.chat.message('disabling vanish selfcare,...');
|
||||
bot.chat.command('v off')
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
const CommandError = require('../../util/command_error');
|
||||
const CommandError = require('../util/command_error');
|
||||
const { request } = require('undici');
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'weather',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'check the weather of cities',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
},
|
||||
name: 'weather',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
],
|
||||
description: 'check the weather of cities',
|
||||
usages: [
|
||||
"<message>"
|
||||
],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
||||
|
@ -42,7 +40,7 @@ module.exports = {
|
|||
{ text: "Wind speed" , color: config.colors.commands.primary },
|
||||
{ text: `${info.current.wind_kph}`, color: config.colors.integer },
|
||||
{ text: `kph`, color: config.colors.commands.secondary },
|
||||
{ text: `${info.current.wind_dir}`, color: config.colors.commands.secondary },
|
||||
{ text: `${info.current.wind_dir}`, color: config.colors.secondary },
|
||||
{ text: `${info.current.wind_mph}`, color: config.colors.integer },
|
||||
{ text: `mph`, color: config.colors.commands.secondary },
|
||||
{ text: `${info.current.wind_dir}`, color: config.colors.commands.secondary },
|
|
@ -1,19 +1,17 @@
|
|||
const http = require('http');
|
||||
const https = require('https');
|
||||
const util = require('util');
|
||||
const fixansi = require('../../util/ansi');
|
||||
const CommandError = require('../../util/command_error')
|
||||
const fixansi = require('../util/ansi');
|
||||
const CommandError = require('../util/command_error')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'website',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
],
|
||||
description: 'look up website data',
|
||||
usages: [
|
||||
"<url>"
|
||||
],
|
||||
},
|
||||
name: 'website',
|
||||
trustLevel: 1,
|
||||
aliases: [
|
||||
],
|
||||
description: 'look up website data',
|
||||
usages: [
|
||||
"<url>"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments;
|
|
@ -1,18 +1,12 @@
|
|||
const wiki = require('wikipedia')
|
||||
const CommandError = require('../../util/command_error')
|
||||
const CommandError = require('../util/command_error')
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
data: {
|
||||
name: 'wiki',
|
||||
description: 'wikipedia',
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
'wikipedia'
|
||||
],
|
||||
usages:[
|
||||
"<definition>"
|
||||
],
|
||||
},
|
||||
name: 'wiki',
|
||||
description:'wikipedia',
|
||||
trustLevel: 0,
|
||||
aliases:['wikipedia'],
|
||||
usages:["<definition>"],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
|
@ -1,19 +0,0 @@
|
|||
module.exports = {
|
||||
data: {
|
||||
name: '<command name>',
|
||||
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
|
||||
aliases: [
|
||||
""
|
||||
],
|
||||
description: '',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
execute (context) {
|
||||
|
||||
},
|
||||
discordExecute (context) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
export default {
|
||||
data: {
|
||||
name: '<command name>',
|
||||
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
|
||||
aliases: [
|
||||
|
||||
],
|
||||
description: '',
|
||||
usages: [
|
||||
""
|
||||
],
|
||||
},
|
||||
execute (context) {
|
||||
|
||||
},
|
||||
discordExecute (context) {
|
||||
|
||||
}
|
||||
}
|
10
src/data/info.json
Normal file
10
src/data/info.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"bot": {
|
||||
"buildstring": {
|
||||
"version": "v6.0.9",
|
||||
"build":"1110",
|
||||
"codename":""
|
||||
},
|
||||
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
|
||||
}
|
||||
}
|
1
src/data/trustedPlayers.json
Normal file
1
src/data/trustedPlayers.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"player":"aaa"},{"player":"Parker2991"},{"player":"FNFBoyfriendBot"}]
|
|
@ -32,38 +32,46 @@ async function command_manager (bot, options, config, discordClient) {
|
|||
})
|
||||
} else if (source?.sources?.console && !source?.sources?.discord) {
|
||||
if (!command || !command.execute)
|
||||
bot.console.warn(bot.getMessageAsPrismarine({
|
||||
translate: "%s%s%s %s",
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{ translate: "command.unknown.command", color: "red" },
|
||||
{ text: "\n" },
|
||||
{ text: `${commandName}` },
|
||||
{ translate: "command.context.here", color: "red" }
|
||||
]
|
||||
})?.toAnsi())
|
||||
bot.console.warn([
|
||||
{
|
||||
translate: 'command.unknown.command',
|
||||
color: "dark_red"
|
||||
},
|
||||
{
|
||||
text: "\n",
|
||||
},
|
||||
{
|
||||
text: `${commandName}`,
|
||||
color: "dark_red"
|
||||
},
|
||||
{
|
||||
translate: "command.context.here",
|
||||
color: "dark_red"
|
||||
}
|
||||
])
|
||||
}
|
||||
if (command?.data?.trustLevel > 0) {
|
||||
|
||||
if (command?.trustLevel > 0) {
|
||||
const event = bot.discord.message;
|
||||
const roles = event?.member?.roles?.cache;
|
||||
if (command?.data?.trustLevel === 1 && !source?.sources?.discord) {
|
||||
if (command?.trustLevel === 1 && !source?.sources?.discord) {
|
||||
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide an trusted or an admin or an owner hash", color: "dark_red" })
|
||||
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' });
|
||||
} else if (command?.data?.trustLevel === 1 && source?.sources.discord) {
|
||||
} else if (command?.trustLevel === 1 && source?.sources.discord) {
|
||||
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.owner}`)
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!', color: "dark_red" })
|
||||
}
|
||||
if (command?.data?.trustLevel === 2 && !source.sources.console) {
|
||||
if (command?.trustLevel === 2 && !source.sources.console) {
|
||||
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or owner hash", color: 'dark_red' })
|
||||
if (args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' });
|
||||
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' });
|
||||
}
|
||||
if (command?.data?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {
|
||||
if (command?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {
|
||||
if (args.length === 0 && bot.validation.owner) throw new CommandError({ text: "Please provide an owner hash", color: "dark_red" })
|
||||
if (args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid owner hash', color: 'dark_red' })
|
||||
} else if (command?.data?.trustLevel === 3 && source.sources.discord && !source.sources.console) {
|
||||
} else if (command?.trustLevel === 3 && source.sources.discord && !source.sources.console) {
|
||||
const hasRole = roles?.some(role => role.name === `${config.discord.roles.owner}`)
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not the owner!', color: "dark_red" })
|
||||
} else if (command?.data?.trustLevel === 4 && !source.sources.console) {
|
||||
} else if (command?.trustLevel === 4 && !source.sources.console) {
|
||||
throw new CommandError({ text: 'This command can only be ran via console', color: "dark_red" });
|
||||
}
|
||||
}
|
||||
|
@ -93,13 +101,17 @@ async function command_manager (bot, options, config, discordClient) {
|
|||
if (bot.options.isSavage || bot.options.isCreayun) {
|
||||
bot.chat.message(`&4${error.message}`)
|
||||
} else {
|
||||
// console.log(error.toString());
|
||||
if (error.toString().length > 256) {
|
||||
bot.tellraw("@a", error._message);
|
||||
} else if (error.toString().length < 256) {
|
||||
bot.chat.message(`${bot.getMessageAsPrismarine(error._message)?.toMotd().replaceAll('§','&')}`)
|
||||
/*}*else if (error.toString().length < 256 && error._useChat === false) {
|
||||
bot.tellraw("@a", error._message);*/
|
||||
} else {
|
||||
bot.tellraw("@a", error._message);
|
||||
}
|
||||
// bot.tellraw("@a", error._message)
|
||||
}
|
||||
} else {
|
||||
if (bot.options.isSavage || bot.options.isCreayun) {
|
||||
|
@ -125,12 +137,16 @@ async function command_manager (bot, options, config, discordClient) {
|
|||
},
|
||||
|
||||
register (command) {
|
||||
this.commands[command.data.name] = command
|
||||
if (command.data.aliases) {
|
||||
command.data.aliases.map((a) => (this.commands[a] = command));
|
||||
this.commands[command.name] = command
|
||||
if (command.aliases) {
|
||||
command.aliases.map((a) => (this.commands[a] = command));
|
||||
}
|
||||
},
|
||||
|
||||
unregister (command) {
|
||||
this.commands = {};
|
||||
},
|
||||
|
||||
getCommand (name) {
|
||||
return this.commands[name]
|
||||
},
|
||||
|
@ -140,32 +156,19 @@ async function command_manager (bot, options, config, discordClient) {
|
|||
},
|
||||
}
|
||||
|
||||
/*
|
||||
file loader ported from my discord bot SkiBot
|
||||
and edited to support mjs files and to support FNFBoyfriendBot's command format
|
||||
*/
|
||||
commandlist = [];
|
||||
const foldersPath = path.join(__dirname, '../commands');
|
||||
const commandFolders = fs.readdirSync(foldersPath);
|
||||
for (const folder of commandFolders) {
|
||||
const commandsPath = path.join(foldersPath, folder);
|
||||
const commandFiles = fs.readdirSync(commandsPath)
|
||||
for (const filename of commandFiles) {
|
||||
try {
|
||||
const filePath = path.join(commandsPath, filename);
|
||||
if (filename.endsWith('.mjs')) {
|
||||
let command = await import(filePath);
|
||||
bot.commandManager.register(command.default);
|
||||
bot.commandManager.commandlist.push(command.default);
|
||||
}
|
||||
if (filename.endsWith('.js')) {
|
||||
let command = require(filePath);
|
||||
bot.commandManager.register(command);
|
||||
bot.commandManager.commandlist.push(command);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load command ', filename, ':', error);
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
if (filename.endsWith('.mjs')) {
|
||||
let commands = await import(path.join(__dirname, '../commands', filename))
|
||||
bot.commandManager.commandlist.push(commands.command);
|
||||
} if (filename.endsWith('.js')) {
|
||||
let commands = require(path.join(__dirname, '../commands', filename));
|
||||
bot.commandManager.register(commands);
|
||||
bot.commandManager.commandlist.push(commands);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load command ', filename, ':', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,25 +94,6 @@ You already have registered this username!
|
|||
}, 1000)
|
||||
})
|
||||
|
||||
bot.on("packet.teams", (data) => {
|
||||
if (options.isSavage || options.isCreayun) return;
|
||||
try {
|
||||
/*
|
||||
if (data.team !== "FNFBoyfriendBot") {
|
||||
bot.chat.command(`minecraft:team add FNFBoyfriendBot`);
|
||||
}
|
||||
if (data.mode > 1 && !data.team === "FNFBoyfriendBot") {
|
||||
bot.chat.command(`minecraft:team add FNFBoyfriendBot`);
|
||||
}
|
||||
if (data.team === "FNFBoyfriendBot") {
|
||||
console.log(data);
|
||||
}
|
||||
*/
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
})
|
||||
|
||||
let timer;
|
||||
bot.on('packet.login', (packet) => {
|
||||
entityId = packet.entityId;
|
||||
|
|
|
@ -15,10 +15,9 @@ module.exports = () => {
|
|||
fs.writeFileSync(path.join(__dirname, "../data/filter.json"), JSON.stringify(data))
|
||||
}
|
||||
|
||||
/*
|
||||
if (!fs.existsSync(path.join(__dirname, "../data/trustedPlayers.json"))) {
|
||||
console.warn("Trusted Players json not found creating the file,......");
|
||||
let data = [{player: ""}]
|
||||
fs.writeFileSync(path.join(__dirname, "../data/trustedPlayers.json"), JSON.stringify(data))
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue