use "value" instead of ${value} + improve rtp

This commit is contained in:
ChomeNS 2022-12-30 15:05:48 +07:00
parent 4f53e61c66
commit e78cda6373
8 changed files with 17 additions and 18 deletions

View file

@ -6,7 +6,7 @@ module.exports = {
usage: '', usage: '',
trusted: 0, trusted: 0,
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, 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, sender, prefix, args, channeldc, message, config) { discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()

View file

@ -7,16 +7,16 @@ module.exports = {
trusted: 0, trusted: 0,
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0]) { if (args[0]) {
bot.tellraw(args.join(' '), [{ text: `${'\n'.repeat(100)}`, color: 'white' }, { text: `Your chat has been cleared by ${username}.`, color: 'dark_green' }]) bot.tellraw(args.join(' '), [{ text: '\n'.repeat(100), color: 'white' }, { text: `Your chat has been cleared by ${username}.`, color: 'dark_green' }])
} else { } else {
bot.tellraw('@a', [{ text: `${'\n'.repeat(100)}`, color: 'white' }, { text: 'The chat has been cleared.', color: 'dark_green' }]) bot.tellraw('@a', [{ text: '\n'.repeat(100), color: 'white' }, { text: 'The chat has been cleared.', color: 'dark_green' }])
} }
}, },
discordExecute (bot, username, sender, prefix, args, channeldc, message) { discordExecute (bot, username, sender, prefix, args, channeldc, message) {
if (args[0]) { if (args[0]) {
bot.tellraw(args.join(' '), [{ text: `${'\n'.repeat(100)}`, color: 'white' }, { text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green' }]) bot.tellraw(args.join(' '), [{ text: '\n'.repeat(100), color: 'white' }, { text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green' }])
} else { } else {
bot.tellraw('@a', [{ text: `${'\n'.repeat(100)}`, color: 'white' }, { text: 'The chat has been cleared.', color: 'dark_green' }]) bot.tellraw('@a', [{ text: '\n'.repeat(100), color: 'white' }, { text: 'The chat has been cleared.', color: 'dark_green' }])
} }
} }
} }

View file

@ -57,7 +57,7 @@ module.exports = {
if (args[1] === 'add' && args[3]) { if (args[1] === 'add' && args[3]) {
if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval') if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval')
bot.cloop.add(args.slice(3).join(' '), args[2]) bot.cloop.add(args.slice(3).join(' '), args[2])
bot.tellraw(selector, [{ text: 'Added command ', color: 'white' }, { text: `${args.slice(3).join(' ')}`, color: 'aqua' }, { text: ' with interval ', color: 'white' }, { text: `${args[2]}`, color: 'green' }, { text: ' to the cloops', color: 'white' }]) bot.tellraw(selector, [{ text: 'Added command ', color: 'white' }, { text: args.slice(3).join(' '), color: 'aqua' }, { text: ' with interval ', color: 'white' }, { text: args[2], color: 'green' }, { text: ' to the cloops', color: 'white' }])
} else if (args[1] === 'list') { } else if (args[1] === 'list') {
list(bot, false, null, selector) list(bot, false, null, selector)
} else if (args[1] === 'remove') { } else if (args[1] === 'remove') {

View file

@ -5,8 +5,7 @@ module.exports = {
usage: '[specific] <player>', usage: '[specific] <player>',
trusted: 0, trusted: 0,
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
// eslint-disable-next-line no-unused-vars // const mcData = require('minecraft-data')(bot.version)
const mcData = require('minecraft-data')(bot.version)
throw new Error('Execute Bypass is patched so this command will be broken for now!') throw new Error('Execute Bypass is patched so this command will be broken for now!')
// if (!args[0]) return; // if (!args[0]) return;
@ -17,7 +16,7 @@ module.exports = {
// bot.tellraw(selector, [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]); // bot.tellraw(selector, [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]);
// } else if (args[1] === 'specific' && args[2]) { // } else if (args[1] === 'specific' && args[2]) {
// bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name); // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name);
// bot.tellraw(selector, [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]); // bot.tellraw(selector, [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: args[2], color: 'aqua'}]);
// } // }
} }
} }

View file

@ -17,9 +17,9 @@ module.exports = {
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === 'run') { if (args[0] === 'run') {
try { try {
bot.tellraw(selector, { text: `${util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize })}`.substring(0, 32000) }) bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
} catch (err) { } catch (err) {
bot.tellraw(selector, { text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red' }) bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'chayapak1'), color: 'red' })
} }
} }
if (args[0] === 'reset') { if (args[0] === 'reset') {
@ -33,9 +33,9 @@ module.exports = {
colors: 'minecraft', colors: 'minecraft',
code: args[1] code: args[1]
})).then((res) => { })).then((res) => {
bot.tellraw(selector, { text: `${res.data}` }) bot.tellraw(selector, { text: res.data })
}).catch((err) => { }).catch((err) => {
bot.tellraw(selector, { text: `${err}`, color: 'red' }) bot.tellraw(selector, { text: err, color: 'red' })
}) })
} }
}, },

View file

@ -6,8 +6,8 @@ module.exports = {
usage: '', usage: '',
trusted: 0, trusted: 0,
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
const rtppos = `${between(20000000, 500000)} 100 ${between(20000000, 500000)}` const pos = `${between(1000, 10000)} 100 ${between(1000, 10000)}`
bot.tellraw(selector, [{ text: 'Teleporting ', color: 'white' }, { text: username, color: 'aqua' }, { text: ' to ', color: 'white' }, { text: rtppos, color: 'green' }, { text: '...', color: 'white' }]) bot.tellraw(selector, [{ text: 'Teleporting ', color: 'white' }, { text: username, color: 'aqua' }, { text: ' to ', color: 'white' }, { text: pos, color: 'green' }, { text: '...', color: 'white' }])
bot.core.run(`essentials:teleport ${sender} ${rtppos}`) bot.core.run(`essentials:teleport ${sender} ${pos}`)
} }
} }

View file

@ -9,7 +9,7 @@ module.exports = {
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
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 component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: `${momented}`, color: 'green' }] const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
bot.tellraw(selector, component) bot.tellraw(selector, component)
} 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')) {

View file

@ -70,7 +70,7 @@ async function inject (bot, dcclient, config) {
}, },
{ text: '] ', color: 'dark_gray' }, { text: '] ', color: 'dark_gray' },
{ {
text: `${message.member.displayName}`, text: message.member.displayName,
color: 'red', color: 'red',
clickEvent: { clickEvent: {
action: 'copy_to_clipboard', action: 'copy_to_clipboard',