Fix scoreboard not displaying when above 2000 characters

This commit is contained in:
Alexandertp 2024-11-20 22:24:06 +01:00
parent ae61e4761f
commit e2ad1e18b4

View File

@ -91,17 +91,22 @@ client.on('interactionCreate', async(interaction) => {
if (interaction.commandName === 'scoreboard' && isManager) { if (interaction.commandName === 'scoreboard' && isManager) {
const updateOrDisplay = interaction.options.get('update-display').value; const updateOrDisplay = interaction.options.get('update-display').value;
const gearchannel = client.channels.cache.get('1255024866797682779'); const gearchannel = client.channels.cache.get('1255024866797682779');
let scoreBoardMessage = await BuildScoreboard("Beastboss"); let scoreBoardMessageBeastboss = await BuildScoreboard("Beastboss");
scoreBoardMessage += await BuildScoreboard("Manager"); let scoreBoardMessageManager = await BuildScoreboard("Manager");
scoreBoardMessage += await BuildScoreboard("Muscle"); let scoreBoardMessageMuscle = await BuildScoreboard("Muscle");
scoreBoardMessage += await BuildScoreboard("Moneymaker"); let scoreBoardMessageMoneymaker = await BuildScoreboard("Moneymaker");
scoreBoardMessage += await BuildScoreboard("Mystic"); let scoreBoardMessageMystic = await BuildScoreboard("Mystic");
scoreBoardMessage += await BuildScoreboard("Intern"); let scoreBoardMessageIntern = await BuildScoreboard("Intern");
if (updateOrDisplay == 'display') { if (updateOrDisplay == 'display') {
console.log("Scoreboard goes here: " + scoreBoardMessage); //console.log("Scoreboard goes here: " + scoreBoardMessage);
if (scoreBoardMessage != "") { if (scoreBoardMessageIntern != "") {
gearchannel.send(scoreBoardMessage); gearchannel.send(scoreBoardMessageBeastboss);
gearchannel.send(scoreBoardMessageManager);
gearchannel.send(scoreBoardMessageMuscle);
gearchannel.send(scoreBoardMessageMoneymaker);
gearchannel.send(scoreBoardMessageMystic);
gearchannel.send(scoreBoardMessageIntern);
interaction.reply({content: "Displaying Scoreboard", ephemeral: true}); interaction.reply({content: "Displaying Scoreboard", ephemeral: true});
} }
else { else {
@ -141,8 +146,8 @@ function AddGear(Type,Employee) {
if (Type == "copper" || Type == "silver" || Type == "gold" || Type == "purple"){ if (Type == "copper" || Type == "silver" || Type == "gold" || Type == "purple"){
Type += "gear"; Type += "gear";
} }
if (Type != "coppergear" && Type != "silvergear" && Type != "goldgear" && Type != "purplegear") return if (Type != "coppergear" && Type != "silvergear" && Type != "goldgear" && Type != "purplegear") return "Nothing";
db.run(`UPDATE Employees SET ${Type} = ${Type} + 1 WHERE name = \'${Employee}\' `) db.run(`UPDATE Employees SET ${Type} = ${Type} + 1 WHERE name = \'${Employee}\' `);
return Type; return Type;
}; };