Skip to content

Commit

Permalink
New update pog?
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckySoLucky authored Aug 21, 2022
2 parents b5bb8e8 + 6a3c273 commit 72ec47b
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 20 deletions.
6 changes: 6 additions & 0 deletions API/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
data/collections.json
package-lock.json
.env
package-lock.json
.prettierrc.json
3 changes: 1 addition & 2 deletions API/data/refreshPrices.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const config = require('../../config.json');
const axios = require('axios');
const fs = require('fs');

Expand All @@ -13,7 +12,7 @@ module.exports = async function refreshPrices() {

if (request.status === 200) {
fs.writeFileSync('./data/prices.json', JSON.stringify(request.data, null, 2));
if (config.console.debug) console.log('[PRICES] Prices updated successfully');
console.log('[PRICES] Prices updated successfully');
} else {
console.log('[PRICES] Failed to update prices: ', request.status);
}
Expand Down
3 changes: 1 addition & 2 deletions API/stats/networth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const itemGenerator = require('../constants/maro_networth/generators/itemGenerator');
const networthGenerator = require('../constants/maro_networth/generators/networthGenerator');
const config = require('../../config.json');
const fs = require('fs');

let prices = {};
Expand All @@ -12,7 +11,7 @@ const retrievePrices = async function () {
const slug = (prices['slug_boots']?.price || 300000) / 15;
prices['crimson_essence'] = { price: moogma > slug ? slug : moogma, name: 'Crimson Essence' };

if (config.console.debug) console.log('Prices retrieved successfully');
console.log('Prices retrieved successfully');
};

retrievePrices();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"prismarine-nbt": "^1.6.0",
"util": "^0.12.4"
}
}
}
2 changes: 1 addition & 1 deletion src/discord/commands/applyCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
.setAuthor({ name: 'Guild Application.'})
.setDescription(`Guild Application has been successfully sent to the guild staff.`)
.setFooter({ text: 'by DuckySoLucky#5181', iconURL: 'https://cdn.discordapp.com/avatars/486155512568741900/164084b936b4461fe9505398f7383a0e.png?size=4096' });
interaction.editReply({content: `\u200B`, embeds: [ applicationEmbed ] })
interaction.editReply({content: `\u200B`, embeds: [applicationEmbed] })

const statsEmbed = new MessageEmbed()
.setColor(`${meetRequirements ? '#00FF00' : '#ff0000'}`)
Expand Down
2 changes: 1 addition & 1 deletion src/discord/commands/inactivityCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ module.exports = {
await interaction.followUp({ embeds: [errorEmbed] });
}
}
}
}
2 changes: 1 addition & 1 deletion src/minecraft/commands/DenickerCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DenickerCommand extends MinecraftCommand {
this.send(`/gc [${player?.rank}] ${response?.player?.ign} is ${response?.data?.nick}`)
}).catch(error => {this.send('/gc ' + error.toString().replaceAll('[hypixel-api-reborn] ', ''))})
} catch (error) {
this.send('/gc There is no player with the given UUID or name or the player has no Skyblock profiles')
this.send('/gc Sorry, I wasn\' able to denick this person.')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/commands/DuelsStatsCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ class DuelsStatsCommand extends MinecraftCommand {
}
}

module.exports = DuelsStatsCommand
module.exports = DuelsStatsCommand
1 change: 1 addition & 0 deletions src/minecraft/commands/auctionHouseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class auctionHouseCommand extends MinecraftCommand {
}
if (string == '') this.send('/gc This player does not have any auctions active.')
} catch (error) {
console.log(error)
this.send(`/gc [ERROR] ${error}`)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/commands/renderPetCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ class renderCommand extends MinecraftCommand {
}


module.exports = renderCommand;
module.exports = renderCommand;
21 changes: 15 additions & 6 deletions src/minecraft/handlers/ChatHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ class StateHandler extends EventHandler {
}

async onMessage(event) {
const message = event.toString()
const message = event.toString();
const colouredMessage = event.toMotd();

if (this.isLobbyJoinMessage(message)) {
return bot.chat('\u00a7')
}

if (this.isPartyMessage(message)) {
let username = replaceAllRanks(message.substr(54))
Expand Down Expand Up @@ -183,12 +187,14 @@ class StateHandler extends EventHandler {
color: '47F049',
channel: 'Guild'
})]
await delay(1500)
bot.chat('/gc Welcome to the guild! Make sure to join our discord /g discord! To view my commands run !help, Have a nice day :D')
}

if (this.isLeaveMessage(message)) {
let user = message.replace(/\[(.*?)\]/g, '').trim().split(/ +/g)[0]
const uuid = await getUUID(user)
if (linked?.[uuid]?.data[0]) {
const uuid = await getUUID(user)
const member = await guild.members.fetch(linked?.[uuid]?.data[0])
member.roles.remove(config.discord.guildMemberRole)
}
Expand All @@ -210,11 +216,10 @@ class StateHandler extends EventHandler {

if (this.isKickMessage(message)) {
let user = message.replace(/\[(.*?)\]/g, '').trim().split(/ +/g)[0]

const uuid = await getUUID(user)
if (linked?.[uuid]?.data[0]) {
const member = await guild.members.fetch(linked?.[uuid]?.data[0])
member.roles.remove(config.discord.guildMemberRole)
}
const member = await guild.members.fetch(linked?.[uuid]?.data[0])
member.roles.remove(config.discord.guildMemberRole)

return [this.minecraft.broadcastHeadedEmbed({
message: `${user} ${messages.kickMessage}`,
Expand Down Expand Up @@ -673,6 +678,10 @@ class StateHandler extends EventHandler {
isAlreadyHasRank(message) {
return message.includes('They already have that rank!') && !message.includes(':')
}

isLobbyJoinMessage(message) {
return (message.endsWith(' the lobby!') || message.endsWith(' the lobby! <<<')) && message.includes('[MVP+')
}

isTooFast(message) {
return message.includes('You are sending commands too fast! Please slow down.') && !message.includes(':')
Expand Down
8 changes: 4 additions & 4 deletions src/web/server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*const express = require('express');
const express = require('express');
const server = express();
server.listen(1382, () => { console.log("Web Server is Ready!") });
server.listen(1439, () => { console.log("Web Server is Ready!") });

server.all('/', (req, res) => {
res.send(`Bot is Online!`)
res.send(` `)
})
*/

//--------------------------------
// If u wanna have fancy website
/*
Expand Down

0 comments on commit 72ec47b

Please sign in to comment.