discord embeds color config

This commit is contained in:
ChomeNS 2022-12-01 17:15:30 +07:00
parent eecd66bb4c
commit b0e158de84
20 changed files with 72 additions and 68 deletions

View file

@ -9,9 +9,9 @@ module.exports = {
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
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, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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}\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -30,12 +30,12 @@ module.exports = {
throw new SyntaxError('Invalid argument') throw new SyntaxError('Invalid argument')
} }
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
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 MessageEmbed()
.setColor('#FFFF00') .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')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -43,7 +43,7 @@ module.exports = {
bot.visibility = false bot.visibility = false
bot.chat('/essentials:vanish enable') bot.chat('/essentials:vanish enable')
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -53,7 +53,7 @@ module.exports = {
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 MessageEmbed()
.setColor('#FFFF00') .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}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -9,10 +9,10 @@ module.exports = {
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.bruhifyText = args.join(' ') bot.bruhifyText = args.join(' ')
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
bot.bruhifyText = args.join(' ') bot.bruhifyText = args.join(' ')
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Bruhify') .setTitle('Bruhify')
.setDescription(`Bruhify set to: ${bot.bruhifyText}`) .setDescription(`Bruhify set to: ${bot.bruhifyText}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -27,14 +27,14 @@ module.exports = {
bot.tellraw(selector, component) bot.tellraw(selector, component)
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
let changelogs = '' let changelogs = ''
changelog.forEach((message, number) => { changelog.forEach((message, number) => {
number += 1 number += 1
changelogs += `\`${number}\` - \`${message}\`` + '\n' changelogs += `\`${number}\` - \`${message}\`` + '\n'
}) })
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle(`Changelogs (${changelog.length})`) .setTitle(`Changelogs (${changelog.length})`)
.setDescription(changelogs) .setDescription(changelogs)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -16,7 +16,7 @@ function clear (bot) {
bot.cloops = [] bot.cloops = []
} }
function list (bot, discord, channeldc, selector) { function list (bot, discord, channeldc, selector, config) {
const message = [] const message = []
if (discord) { if (discord) {
@ -32,7 +32,7 @@ function list (bot, discord, channeldc, selector) {
message.pop() message.pop()
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Cloops') .setTitle('Cloops')
.setDescription(message.join('')) .setDescription(message.join(''))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -84,29 +84,29 @@ module.exports = {
throw new SyntaxError('Invalid argument') throw new SyntaxError('Invalid argument')
} }
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
if (!bot.cloops) bot.cloops = [] if (!bot.cloops) bot.cloops = []
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')
add(args.slice(2).join(' '), args[1], bot) add(args.slice(2).join(' '), args[1], bot)
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} else if (args[0] === 'list') { } else if (args[0] === 'list') {
list(bot, true, channeldc) list(bot, true, channeldc, '@a', config)
} else if (args[0] === 'remove') { } else if (args[0] === 'remove') {
remove(args[1], bot) remove(args[1], bot)
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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') { } else if (args[0] === 'removeall') {
clear(bot) clear(bot)
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Cloop') .setTitle('Cloop')
.setDescription('Removed all looped commands') .setDescription('Removed all looped commands')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -36,7 +36,7 @@ module.exports = {
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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]] }))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -9,9 +9,9 @@ module.exports = {
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
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, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Creator') .setTitle('Creator')
.setDescription('ChomeNS Bot was created by chayapak') .setDescription('ChomeNS Bot was created by chayapak')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -43,7 +43,7 @@ module.exports = {
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
if (args[0] === 'run') { if (args[0] === 'run') {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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)}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -57,7 +57,7 @@ module.exports = {
code: args[1] code: args[1]
})).then((res) => { })).then((res) => {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(`\`\`\`${res.data}\`\`\``) .setDescription(`\`\`\`${res.data}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -97,7 +97,7 @@ module.exports = {
bot.tellraw(selector, [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, message, config) {
if (args[0]) { if (args[0]) {
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
function run () { function run () {
@ -107,7 +107,7 @@ module.exports = {
alias = command.alias.join(', ') alias = command.alias.join(', ')
} }
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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}
Supported: ${command.discordExecute ? 'true' : 'false'} Supported: ${command.discordExecute ? 'true' : 'false'}
@ -133,7 +133,7 @@ module.exports = {
unsupportedCommands += command.name + ' ' unsupportedCommands += command.name + ' '
} }
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -58,7 +58,7 @@ module.exports = {
} }
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
try { try {
let players = '' let players = ''
for (const property of bot.players.list) { for (const property of bot.players.list) {
@ -66,7 +66,7 @@ module.exports = {
players += `\`${property.name}\` \`${property.UUID}\`` + '\n' players += `\`${property.name}\` \`${property.UUID}\`` + '\n'
} }
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -19,7 +19,7 @@ if (os.hostname() === 'chomens-kubuntu') {
let song let song
async function play (bot, values, discord, channeldc, selector) { async function play (bot, values, discord, channeldc, selector, config) {
try { try {
const filepath = values.join(' ') const filepath = values.join(' ')
const absolutePath = await resolve(filepath) const absolutePath = await resolve(filepath)
@ -28,7 +28,7 @@ async function play (bot, values, discord, channeldc, selector) {
bot.music.play(song) bot.music.play(song)
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -38,7 +38,7 @@ async function play (bot, values, discord, channeldc, selector) {
} catch (e) { } catch (e) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription('```SyntaxError: Invalid file```') .setDescription('```SyntaxError: Invalid file```')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -48,7 +48,7 @@ async function play (bot, values, discord, channeldc, selector) {
} }
} }
async function playUrl (bot, values, discord, channeldc, selector) { async function playUrl (bot, values, discord, channeldc, selector, config) {
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', {
@ -62,7 +62,7 @@ async function playUrl (bot, values, discord, channeldc, selector) {
bot.music.play(song) bot.music.play(song)
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -72,7 +72,7 @@ async function playUrl (bot, values, discord, channeldc, selector) {
} catch (e) { } catch (e) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription('```SyntaxError: Invalid URL```') .setDescription('```SyntaxError: Invalid URL```')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -89,7 +89,7 @@ async function resolve (filepath) {
return filepath return filepath
} }
async function list (bot, discord, channeldc, prefix, selector, args) { async function list (bot, discord, channeldc, prefix, selector, args, config) {
try { try {
let absolutePath let absolutePath
if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' '))) if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' ')))
@ -101,7 +101,7 @@ async function list (bot, discord, channeldc, prefix, selector, args) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Songs') .setTitle('Songs')
.setDescription(listed.join(', ')) .setDescription(listed.join(', '))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -136,7 +136,7 @@ async function list (bot, discord, channeldc, prefix, selector, args) {
} catch (e) { } catch (e) {
if (discord) { if (discord) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e.toString()}\`\`\``) .setDescription(`\`\`\`${e.toString()}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -164,10 +164,10 @@ module.exports = {
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { execute (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), false, null, selector) play(bot, args.slice(1), false, null, selector, config)
break break
case 'playurl': case 'playurl':
playUrl(bot, args.slice(1), false, null, selector) playUrl(bot, args.slice(1), false, null, selector, config)
break break
case 'stop': case 'stop':
try { try {
@ -222,7 +222,7 @@ module.exports = {
} }
break break
case 'list': case 'list':
list(bot, false, null, prefix, selector, args) list(bot, false, null, prefix, selector, args, config)
break break
case 'nowplaying': case 'nowplaying':
bot.tellraw(selector, [ bot.tellraw(selector, [
@ -253,19 +253,19 @@ module.exports = {
throw new SyntaxError('Invalid argument') throw new SyntaxError('Invalid argument')
} }
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
let Embed let Embed
switch (args[0]) { switch (args[0]) {
case 'play': case 'play':
play(bot, args.slice(1), true, channeldc) play(bot, args.slice(1), true, channeldc, config)
break break
case 'playurl': case 'playurl':
playUrl(bot, args.slice(1), true, channeldc) playUrl(bot, args.slice(1), true, channeldc, config)
break break
case 'stop': case 'stop':
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Stop') .setTitle('Stop')
.setDescription('Cleared the song queue') .setDescription('Cleared the song queue')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -277,7 +277,7 @@ module.exports = {
case 'skip': case 'skip':
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Skip') .setTitle('Skip')
.setDescription(`Skipping ${bot.music.song.name}`) .setDescription(`Skipping ${bot.music.song.name}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -291,7 +291,7 @@ module.exports = {
case 'off': case 'off':
bot.music.loop = 0 bot.music.loop = 0
Embed = new MessageEmbed() Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Loop') .setTitle('Loop')
.setDescription('Looping is now disabled') .setDescription('Looping is now disabled')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -299,7 +299,7 @@ module.exports = {
case 'current': case 'current':
bot.music.loop = 1 bot.music.loop = 1
Embed = new MessageEmbed() Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Loop') .setTitle('Loop')
.setDescription(`Now looping ${song.name}`) .setDescription(`Now looping ${song.name}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -307,7 +307,7 @@ module.exports = {
case 'all': case 'all':
bot.music.loop = 2 bot.music.loop = 2
Embed = new MessageEmbed() Embed = new MessageEmbed()
.setColor('#FFFF00') .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')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -315,11 +315,11 @@ module.exports = {
} }
break break
case 'list': case 'list':
list(bot, true, channeldc, prefix, '@a', args) list(bot, true, channeldc, prefix, '@a', args, config)
break break
case 'nowplaying': case 'nowplaying':
Embed = new MessageEmbed() Embed = new MessageEmbed()
.setColor('#FFFF00') .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}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -328,7 +328,7 @@ module.exports = {
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 MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Queue') .setTitle('Queue')
.setDescription(queueWithName.join(', ')) .setDescription(queueWithName.join(', '))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -19,13 +19,13 @@ module.exports = {
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Output') .setTitle('Output')
.setDescription(util.inspect(eval(args.join(' ')), { stylize })) .setDescription(util.inspect(eval(args.join(' ')), { stylize }))
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} catch (err) { } catch (err) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``) .setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -30,9 +30,9 @@ module.exports = {
} }
]) ])
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .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(' ')}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -19,13 +19,13 @@ module.exports = {
bot.tellraw(selector, component) bot.tellraw(selector, component)
} }
}, },
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
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 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 MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Time') .setTitle('Time')
.setDescription(description) .setDescription(description)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
@ -33,7 +33,7 @@ module.exports = {
throw new SyntaxError('Invalid timezone') throw new SyntaxError('Invalid timezone')
} else { } else {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Time') .setTitle('Time')
.setDescription(description) .setDescription(description)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -15,17 +15,17 @@ module.exports = {
bot.tellraw(selector, { 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, 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 MessageEmbed()
.setColor('#FFFF00') .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 MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e}\`\`\``) .setDescription(`\`\`\`${e}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -10,9 +10,9 @@ module.exports = {
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw(selector, [{ 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 (bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('Bot\'s Uptime') .setTitle('Bot\'s Uptime')
.setDescription(`The bot's uptime is ${secondsToHms(Math.floor(performance.now() / 1000))}`) .setDescription(`The bot's uptime is ${secondsToHms(Math.floor(performance.now() / 1000))}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -68,13 +68,13 @@ module.exports = {
const player = bot.playersAddedPlayers[playername] const player = bot.playersAddedPlayers[playername]
if (player === undefined) throw new SyntaxError('Invalid UUID') if (player === undefined) throw new SyntaxError('Invalid UUID')
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor(config.discord.embedsColors.normal)
.setTitle('UUID') .setTitle('UUID')
.setDescription(`${playername}'s UUID: ${player}`) .setDescription(`${playername}'s UUID: ${player}`)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })
} else { } else {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription('Invalid player name') .setDescription('Invalid player name')
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -17,18 +17,18 @@ module.exports = {
bot.tellraw(selector, { 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, message, config) {
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 MessageEmbed()
.setColor('#FFFF00') .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 MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${util.inspect(e)}\`\`\``) .setDescription(`\`\`\`${util.inspect(e)}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })

View file

@ -53,6 +53,10 @@ module.exports = {
'mc.chomens41793.ga': '1010734897796763758', 'mc.chomens41793.ga': '1010734897796763758',
'real.chipmunk.land': '1042590315464364032' 'real.chipmunk.land': '1042590315464364032'
}, },
embedsColors: {
normal: '#FFFF00',
error: '#FF0000'
},
prefix: '!' prefix: '!'
}, },
servers: [ servers: [

View file

@ -47,7 +47,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 MessageEmbed()
.setColor('#FF0000') .setColor(config.discord.embedsColors.error)
.setTitle('Error') .setTitle('Error')
.setDescription(`\`\`\`${e}\`\`\``) .setDescription(`\`\`\`${e}\`\`\``)
channeldc.send({ embeds: [Embed] }) channeldc.send({ embeds: [Embed] })