I'm tired of making release candidates
This commit is contained in:
7cc5c4f330d47060 2024-08-18 13:38:09 -04:00
parent 17ac994fe9
commit 314e9c3f9c
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
5 changed files with 45 additions and 45 deletions

View file

@ -4,7 +4,7 @@ module.exports = {
execute: (c) => {
if (c.bot.host && c.bot.host.options.netmsgDisabled) {
c.reply({
text: getMessage(c.lang, "command.netmsg.disabled"),
text: getMessage(c.lang, 'command.netmsg.disabled'),
color: c.colors.secondary
})
return

View file

@ -4,22 +4,22 @@ module.exports = {
execute: (c) => {
const subcmd = c.args.splice(0, 1)[0]
switch (subcmd) {
case 'set':
const allowedKeys = ["colorPrimary", "colorSecondary", "lang"]
case 'set':{
const allowedKeys = ['colorPrimary', 'colorSecondary', 'lang']
const key = c.args.splice(0, 1)[0]
if (!allowedKeys.includes(key)) {
c.reply({
text: getMessage(c.lang, 'command.settings.error.invalidKey'),
color: c.colors.secondary
});
return;
})
return
}
const value = c.args.join(" ")
if(value === "" && key==="lang"){
const value = c.args.join(' ')
if (value === '' && key === 'lang') {
// Show all valid languages to user
for (const i in languages) {
c.reply({
translate: "%s (%s)",
translate: '%s (%s)',
color: c.colors.secondary,
with: [
{
@ -32,7 +32,7 @@ module.exports = {
}
],
hoverEvent: {
action: "show_text",
action: 'show_text',
value: {
translate: getMessage(languages[i], 'command.settings.setLanguage'),
with: [
@ -47,19 +47,19 @@ module.exports = {
}
return
}
if(value === ""){
if (value === '') {
c.reply({
text: getMessage(c.lang, 'command.settings.error.mustProvideValue'),
color: c.colors.secondary
});
return;
})
return
}
if(key==="lang" && !languages.includes(value)){
if (key === 'lang' && !languages.includes(value)) {
c.reply({
text: getMessage(c.lang, 'command.settings.error.invalidLanguage'),
color: c.colors.secondary
});
return;
})
return
}
c.prefs[key] = value
@ -73,11 +73,12 @@ module.exports = {
c.reply({
text: getMessage(c.lang, 'command.settings.saved'),
color: c.colors.secondary
});
break;
case 'get':{
})
break
}
case 'get':
c.reply({
translate: "%s: %s",
translate: '%s: %s',
color: c.colors.primary,
with: [
{
@ -91,7 +92,7 @@ module.exports = {
]
})
c.reply({
translate: "%s: %s",
translate: '%s: %s',
color: c.colors.primary,
with: [
{
@ -105,7 +106,7 @@ module.exports = {
]
})
c.reply({
translate: "%s: %s (%s)",
translate: '%s: %s (%s)',
color: c.colors.primary,
with: [
{
@ -123,7 +124,6 @@ module.exports = {
]
})
break
}
default:
c.reply({
translate: getMessage(c.lang, 'command.cloop.error.subcommand'),

View file

@ -3,9 +3,9 @@ const hashcheck = require('../util/hashcheck.js')
const settings = require('../settings.json')
const { getMessage } = require('../util/lang.js')
const cmds = require('../util/commands.js')
const fs = require("fs")
const fs = require('fs')
if(!fs.readdirSync('.').includes('userPref')) fs.mkdirSync("userPref");
if (!fs.readdirSync('.').includes('userPref')) fs.mkdirSync('userPref')
const loadSettings = function (uuid) {
try {
@ -21,7 +21,7 @@ module.exports = {
b.runCommand = (name, uuid, text, prefix) => {
if (uuid === '00000000-0000-0000-0000-000000000000') return
if (Date.now() - b.lastCmd <= 1000) return
const userSettings = loadSettings(uuid);
const userSettings = loadSettings(uuid)
b.lastCmd = Date.now()
const cmd = text.split(' ')
const lang = settings.defaultLang

View file

@ -24,7 +24,7 @@ class Command {
this.lang = settings.defaultLang
}
let _colors = {}
const _colors = {}
if (prefs.colorPrimary) {
_colors.primary = prefs.colorPrimary
} else {