update packages + make discord.js 14 work

This commit is contained in:
ChomeNS 2022-12-24 12:59:52 +07:00
parent 7a2e6ef96b
commit 93494c9feb
21 changed files with 72 additions and 76 deletions

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'botuser', name: 'botuser',
alias: [], alias: [],
@ -9,7 +9,7 @@ module.exports = {
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' }] } }]) 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 (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s User') .setTitle('Bot\'s User')
.setDescription(`The bot's username is: \`${bot.username}\` and the UUID is: \`${bot.uuid}\``) .setDescription(`The bot's username is: \`${bot.username}\` and the UUID is: \`${bot.uuid}\``)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'botvisibility', name: 'botvisibility',
alias: ['botvis', 'togglevis', 'togglevisibility'], alias: ['botvis', 'togglevis', 'togglevisibility'],
@ -33,7 +33,7 @@ module.exports = {
if (args[0] === 'true' || args[0] === 'on') { if (args[0] === 'true' || args[0] === 'on') {
bot.visibility = true bot.visibility = true
bot.chat('/essentials:vanish disable') bot.chat('/essentials:vanish disable')
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s Visibility') .setTitle('Bot\'s Visibility')
.setDescription('The bot\'s visibility is now visible') .setDescription('The bot\'s visibility is now visible')
@ -41,7 +41,7 @@ module.exports = {
} else if (args[0] === 'false' || args[0] === 'off') { } else if (args[0] === 'false' || args[0] === 'off') {
bot.visibility = false bot.visibility = false
bot.chat('/essentials:vanish enable') bot.chat('/essentials:vanish enable')
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s Visibility') .setTitle('Bot\'s Visibility')
.setDescription('The bot\'s visibility is now invisible') .setDescription('The bot\'s visibility is now invisible')
@ -51,7 +51,7 @@ module.exports = {
const visibleOrInvisible = bot.visibility ? 'visible' : 'invisible' const visibleOrInvisible = bot.visibility ? 'visible' : 'invisible'
const enableOrDisable = bot.visibility ? 'disable' : 'enable' const enableOrDisable = bot.visibility ? 'disable' : 'enable'
bot.chat(`/essentials:vanish ${enableOrDisable}`) bot.chat(`/essentials:vanish ${enableOrDisable}`)
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s Visibility') .setTitle('Bot\'s Visibility')
.setDescription(`The bot's visibility is now ${visibleOrInvisible}`) .setDescription(`The bot's visibility is now ${visibleOrInvisible}`)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'bruhify', name: 'bruhify',
alias: [], alias: [],
@ -10,7 +10,7 @@ module.exports = {
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
bot.bruhifyText = args.join(' ') bot.bruhifyText = args.join(' ')
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bruhify') .setTitle('Bruhify')
.setDescription(`Bruhify set to: ${bot.bruhifyText}`) .setDescription(`Bruhify set to: ${bot.bruhifyText}`)

View file

@ -1,5 +1,5 @@
const changelog = require('../changelog.json') const changelog = require('../changelog.json')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'changelog', name: 'changelog',
alias: ['changelogs'], alias: ['changelogs'],
@ -32,7 +32,7 @@ module.exports = {
number += 1 number += 1
changelogs += `\`${number}\` - \`${message}\`` + '\n' changelogs += `\`${number}\` - \`${message}\`` + '\n'
}) })
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle(`Changelogs (${changelog.length})`) .setTitle(`Changelogs (${changelog.length})`)
.setDescription(changelogs) .setDescription(changelogs)

View file

@ -1,5 +1,5 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
function list (bot, discord, channeldc, selector, config) { function list (bot, discord, channeldc, selector, config) {
const message = [] const message = []
@ -17,7 +17,7 @@ function list (bot, discord, channeldc, selector, config) {
message.pop() message.pop()
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Cloops') .setTitle('Cloops')
.setDescription(message.join('')) .setDescription(message.join(''))
@ -74,7 +74,7 @@ module.exports = {
if (args[0] === 'add' && args[2]) { if (args[0] === 'add' && args[2]) {
if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval') if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval')
bot.cloop.add(args.slice(2).join(' '), args[1]) bot.cloop.add(args.slice(2).join(' '), args[1])
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Cloop') .setTitle('Cloop')
.setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`) .setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`)
@ -83,14 +83,14 @@ module.exports = {
list(bot, true, channeldc, '@a', config) list(bot, true, channeldc, '@a', config)
} else if (args[0] === 'remove') { } else if (args[0] === 'remove') {
bot.cloop.remove(args[1]) bot.cloop.remove(args[1])
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Cloop') .setTitle('Cloop')
.setDescription(`Removed cloop \`${args[1]}\``) .setDescription(`Removed cloop \`${args[1]}\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} else if (args[0] === 'removeall' || args[0] === 'clear') { } else if (args[0] === 'removeall' || args[0] === 'clear') {
bot.cloop.clear() bot.cloop.clear()
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Cloop') .setTitle('Cloop')
.setDescription('Removed all looped commands') .setDescription('Removed all looped commands')

View file

@ -1,6 +1,6 @@
const cowsay = require('cowsay2') const cowsay = require('cowsay2')
const cows = require('cowsay2/cows') const cows = require('cowsay2/cows')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'cowsay', name: 'cowsay',
alias: [], alias: [],
@ -34,7 +34,7 @@ module.exports = {
} }
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Cowsay') .setTitle('Cowsay')
.setDescription(cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] })) .setDescription(cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }))

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'creator', name: 'creator',
alias: [], alias: [],
@ -9,7 +9,7 @@ module.exports = {
bot.tellraw(selector, [{ 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 (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Creator') .setTitle('Creator')
.setDescription('ChomeNS Bot was created by chayapak') .setDescription('ChomeNS Bot was created by chayapak')

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const { VM } = require('vm2') const { VM } = require('vm2')
const axios = require('axios') const axios = require('axios')
const util = require('util') const util = require('util')
@ -41,7 +41,7 @@ module.exports = {
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
if (args[0] === 'run') { if (args[0] === 'run') {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(`\`\`\`${util.inspect(bot.vm.run(args.slice(1).join(' '))).substring(0, 1950)}\`\`\``) .setDescription(`\`\`\`${util.inspect(bot.vm.run(args.slice(1).join(' '))).substring(0, 1950)}\`\`\``)
@ -55,7 +55,7 @@ module.exports = {
showErrorMsg: false, showErrorMsg: false,
code: args[1] code: args[1]
})).then((res) => { })).then((res) => {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(`\`\`\`${res.data}\`\`\``) .setDescription(`\`\`\`${res.data}\`\`\``)

View file

@ -1,6 +1,6 @@
/* eslint-disable no-var */ /* eslint-disable no-var */
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'help', name: 'help',
alias: ['heko', 'cmds', 'commands'], alias: ['heko', 'cmds', 'commands'],
@ -105,7 +105,7 @@ module.exports = {
if (command.alias.toString() !== '') { if (command.alias.toString() !== '') {
alias = command.alias.join(', ') alias = command.alias.join(', ')
} }
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle(`${prefix + command.name} (${alias}) - ${command.description}`) .setTitle(`${prefix + command.name} (${alias}) - ${command.description}`)
.setDescription(`Trust level: ${command.trusted} .setDescription(`Trust level: ${command.trusted}
@ -131,7 +131,7 @@ module.exports = {
if (command.discordExecute || command.proxy) continue if (command.discordExecute || command.proxy) continue
unsupportedCommands += command.name + ' ' unsupportedCommands += command.name + ' '
} }
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle(`Commands (Length: ${bot.command_handler.commands.length})`) .setTitle(`Commands (Length: ${bot.command_handler.commands.length})`)
.setDescription('**Supported Commands**\n' + supportedCommands + '\n**Unsupported Commands**\n' + unsupportedCommands) .setDescription('**Supported Commands**\n' + supportedCommands + '\n**Unsupported Commands**\n' + unsupportedCommands)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'list', name: 'list',
alias: [], alias: [],
@ -64,7 +64,7 @@ module.exports = {
// if (property.match.startsWith('@')) continue; // if (property.match.startsWith('@')) continue;
players += `\`${property.name}\` \`${property.UUID}\`` + '\n' players += `\`${property.name}\` \`${property.UUID}\`` + '\n'
} }
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle(`Players (${bot.players.list.length})`) .setTitle(`Players (${bot.players.list.length})`)
.setDescription(players.substring(0, 4096)) .setDescription(players.substring(0, 4096))

View file

@ -1,7 +1,7 @@
/* eslint-disable no-case-declarations */ /* eslint-disable no-case-declarations */
const fs = require('fs/promises') const fs = require('fs/promises')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const path = require('path') const path = require('path')
const fileExists = require('../util/file-exists') const fileExists = require('../util/file-exists')
const fileList = require('../util/file-list') const fileList = require('../util/file-list')
@ -35,7 +35,7 @@ async function play (bot, values, discord, channeldc, selector, config) {
bot.music.queue.push(song) bot.music.queue.push(song)
bot.music.play(song) bot.music.play(song)
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Music') .setTitle('Music')
.setDescription(`Added ${song.name} to the song queue`) .setDescription(`Added ${song.name} to the song queue`)
@ -45,7 +45,7 @@ async function play (bot, values, discord, channeldc, selector, config) {
} }
} catch (e) { } catch (e) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription('```SyntaxError: Invalid file```') .setDescription('```SyntaxError: Invalid file```')
@ -70,7 +70,7 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
bot.music.queue.push(song) bot.music.queue.push(song)
bot.music.play(song) bot.music.play(song)
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Music') .setTitle('Music')
.setDescription(`Added ${song.name} to the song queue`) .setDescription(`Added ${song.name} to the song queue`)
@ -81,7 +81,7 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
} catch (_err) { } catch (_err) {
const e = response.data.toString() const e = response.data.toString()
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e}\`\`\``) .setDescription(`\`\`\`${e}\`\`\``)
@ -110,7 +110,7 @@ async function list (bot, discord, channeldc, prefix, selector, args, config) {
const listed = await fileList(absolutePath) const listed = await fileList(absolutePath)
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Songs') .setTitle('Songs')
.setDescription(listed.join(', ')) .setDescription(listed.join(', '))
@ -145,7 +145,7 @@ async function list (bot, discord, channeldc, prefix, selector, args, config) {
bot.tellraw(selector, message) bot.tellraw(selector, message)
} catch (e) { } catch (e) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e.toString()}\`\`\``) .setDescription(`\`\`\`${e.toString()}\`\`\``)
@ -274,7 +274,7 @@ module.exports = {
break break
case 'stop': case 'stop':
try { try {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Stop') .setTitle('Stop')
.setDescription('Cleared the song queue') .setDescription('Cleared the song queue')
@ -286,7 +286,7 @@ module.exports = {
break break
case 'skip': case 'skip':
try { try {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Skip') .setTitle('Skip')
.setDescription(`Skipping ${bot.music.song.name}`) .setDescription(`Skipping ${bot.music.song.name}`)
@ -300,7 +300,7 @@ module.exports = {
switch (args[1]) { switch (args[1]) {
case 'off': case 'off':
bot.music.loop = 0 bot.music.loop = 0
Embed = new MessageEmbed() Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Loop') .setTitle('Loop')
.setDescription('Looping is now disabled') .setDescription('Looping is now disabled')
@ -308,7 +308,7 @@ module.exports = {
break break
case 'current': case 'current':
bot.music.loop = 1 bot.music.loop = 1
Embed = new MessageEmbed() Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Loop') .setTitle('Loop')
.setDescription(`Now looping ${song.name}`) .setDescription(`Now looping ${song.name}`)
@ -316,7 +316,7 @@ module.exports = {
break break
case 'all': case 'all':
bot.music.loop = 2 bot.music.loop = 2
Embed = new MessageEmbed() Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Loop') .setTitle('Loop')
.setDescription('Now looping every song in the queue') .setDescription('Now looping every song in the queue')
@ -328,7 +328,7 @@ module.exports = {
list(bot, true, channeldc, prefix, '@a', args, config) list(bot, true, channeldc, prefix, '@a', args, config)
break break
case 'nowplaying': case 'nowplaying':
Embed = new MessageEmbed() Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Now playing') .setTitle('Now playing')
.setDescription(`Now playing ${bot.music.song.name}`) .setDescription(`Now playing ${bot.music.song.name}`)
@ -337,7 +337,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))
Embed = new MessageEmbed() Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Queue') .setTitle('Queue')
.setDescription(queueWithName.join(', ')) .setDescription(queueWithName.join(', '))

View file

@ -1,7 +1,7 @@
/* eslint-disable no-eval */ /* eslint-disable no-eval */
const util = require('util') const util = require('util')
const { stylize } = require('../util/colors/minecraft') const { stylize } = require('../util/colors/minecraft')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'servereval', name: 'servereval',
alias: [], alias: [],
@ -17,13 +17,13 @@ module.exports = {
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
try { try {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(util.inspect(eval(args.join(' ')))) .setDescription(util.inspect(eval(args.join(' '))))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} catch (err) { } catch (err) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``) .setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'test', name: 'test',
alias: [], alias: [],
@ -26,7 +26,7 @@ module.exports = {
]) ])
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Hello!') .setTitle('Hello!')
.setDescription('This is the first ever command to be discordified!' + '\n' + `More info: Username: ${username}, Prefix: ${prefix}, Args: ${args.join(' ')}`) .setDescription('This is the first ever command to be discordified!' + '\n' + `More info: Username: ${username}, Prefix: ${prefix}, Args: ${args.join(' ')}`)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const moment = require('moment-timezone') const moment = require('moment-timezone')
module.exports = { module.exports = {
name: 'time', name: 'time',
@ -23,7 +23,7 @@ module.exports = {
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 description = `The current date and time for the timezone ${timezone} is: ${momented}` const description = `The current date and time for the timezone ${timezone} is: ${momented}`
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Time') .setTitle('Time')
.setDescription(description) .setDescription(description)
@ -31,7 +31,7 @@ module.exports = {
} 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 {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Time') .setTitle('Time')
.setDescription(description) .setDescription(description)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const translate = require('@vitalets/google-translate-api') const translate = require('@vitalets/google-translate-api')
module.exports = { module.exports = {
name: 'translate', name: 'translate',
@ -17,13 +17,13 @@ module.exports = {
discordExecute: async function (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute: async function (bot, username, sender, prefix, args, channeldc, message, config) {
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] })
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Result') .setTitle('Result')
.setDescription(res.text) .setDescription(res.text)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} catch (e) { } catch (e) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e}\`\`\``) .setDescription(`\`\`\`${e}\`\`\``)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const moment = require('moment-timezone') const moment = require('moment-timezone')
module.exports = { module.exports = {
name: 'uptime', name: 'uptime',
@ -12,7 +12,7 @@ module.exports = {
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const time = moment.utc(Math.floor(performance.now())).format('H [hours], m [minutes], s [seconds]') const time = moment.utc(Math.floor(performance.now())).format('H [hours], m [minutes], s [seconds]')
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s Uptime') .setTitle('Bot\'s Uptime')
.setDescription(`The bot's uptime is ${time}`) .setDescription(`The bot's uptime is ${time}`)

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'uuid', name: 'uuid',
alias: [], alias: [],
@ -68,13 +68,13 @@ module.exports = {
const player = bot.players.list.find((user) => user.name === playername) const player = bot.players.list.find((user) => user.name === playername)
if (!player) throw new SyntaxError('Invalid username') if (!player) throw new SyntaxError('Invalid username')
const playerUUID = player.UUID const playerUUID = player.UUID
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('UUID') .setTitle('UUID')
.setDescription(`${playername}'s UUID: ${playerUUID}`) .setDescription(`${playername}'s UUID: ${playerUUID}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} else { } else {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription('No player name specified') .setDescription('No player name specified')

View file

@ -1,6 +1,6 @@
const wiki = require('wikipedia') const wiki = require('wikipedia')
const util = require('util') const util = require('util')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
module.exports = { module.exports = {
name: 'wikipedia', name: 'wikipedia',
alias: ['wiki'], alias: ['wiki'],
@ -20,13 +20,13 @@ 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()
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal) .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(summary.extract) .setDescription(summary.extract)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} catch (e) { } catch (e) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${util.inspect(e)}\`\`\``) .setDescription(`\`\`\`${util.inspect(e)}\`\`\``)

View file

@ -3,14 +3,10 @@ const { stdin: input, stdout: output } = require('node:process')
const rl = readline.createInterface({ input, output }) const rl = readline.createInterface({ input, output })
const config = require('./config') const config = require('./config')
const { createBot } = require('./bot') const { createBot } = require('./bot')
const { const { Client, GatewayIntentBits } = require('discord.js')
Client, const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
Intents
} = require('discord.js') const dcclient = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const intents = new Intents(['GUILDS', 'GUILD_MESSAGES'])
const dcclient = new Client({
intents
})
let bots = [] let bots = []

View file

@ -12,14 +12,14 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@tonejs/midi": "^2.0.28", "@tonejs/midi": "^2.0.28",
"@vitalets/google-translate-api": "^8.0.0", "@vitalets/google-translate-api": "^9.0.0",
"axios": "^0.27.2", "axios": "^1.2.1",
"color-convert": "^2.0.1", "color-convert": "^2.0.1",
"cowsay2": "^2.0.4", "cowsay2": "^2.0.4",
"discord.js": "^13.7.0", "discord.js": "^14.7.1",
"minecraft-data": "^3.11.0", "minecraft-data": "^3.11.0",
"minecraft-protocol": "^1.36.1", "minecraft-protocol": "^1.26.5",
"mineflayer": "^4.3.0", "mineflayer": "^4.0.0",
"moment-timezone": "^0.5.34", "moment-timezone": "^0.5.34",
"prismarine-chat": "^1.7.2", "prismarine-chat": "^1.7.2",
"prismarine-nbt": "^2.2.1", "prismarine-nbt": "^2.2.1",
@ -27,7 +27,7 @@
"sharp": "^0.31.1", "sharp": "^0.31.1",
"sleep-promise": "^9.1.0", "sleep-promise": "^9.1.0",
"urban-dictionary": "^3.0.2", "urban-dictionary": "^3.0.2",
"uuid-by-string": "^3.0.7", "uuid-by-string": "^4.0.0",
"vec3": "^0.1.7", "vec3": "^0.1.7",
"vm2": "^3.9.11", "vm2": "^3.9.11",
"wikipedia": "^1.1.9" "wikipedia": "^1.1.9"

View file

@ -1,6 +1,6 @@
const path = require('path') const path = require('path')
const { MessageEmbed } = require('discord.js') const { EmbedBuilder } = require('discord.js')
function inject (bot, dcclient, config) { function inject (bot, dcclient, config) {
const loadFiles = require('../util/load_files') 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])
@ -45,7 +45,7 @@ function inject (bot, dcclient, config) {
} }
} catch (e) { } catch (e) {
if (prefix === config.discord.prefix) { if (prefix === config.discord.prefix) {
const Embed = new MessageEmbed() const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.error) .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e}\`\`\``) .setDescription(`\`\`\`${e}\`\`\``)