Skip to content

Commit e7c2b8e

Browse files
Merge branch 'master' of https://github.com/P2PHackClub/PixTools
2 parents e5c10a7 + ad46618 commit e7c2b8e

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

22
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8755fad425e049b9b55ea0e40d9a3c60)](https://app.codacy.com/gh/P2PHackClub/PixTools?utm_source=github.com&utm_medium=referral&utm_content=P2PHackClub/PixTools&utm_campaign=Badge_Grade_Dashboard)
33

4-
Lorem ipsum..
4+
# PixTools
5+
*A Discord bot for Hypixel queues..*

commands/list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77

88
fetch('https://api.hypixel.net/gameCounts?key=${hypixel}')
99
.then(result => result.json())
10-
.then(({ games }) => {
10+
.then(({ data, games }) => {
1111
const obj = JSON.parse(games);
1212
const listArr = data.map(obj => obj.games)
1313
message.channel.send(listArr);

index.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,28 @@ client.once('ready', () => {
2828
console.log(`Logged in as ${client.user.tag} and on ${client.guilds.size} guilds with ${client.users.size} users.`);
2929
});
3030

31-
client.on("guildCreate", () => {
31+
client.on("guildCreate", (guild) => {
32+
console.log(`[GUILD_CREATE]: Invited to ${guild.name}.`)
3233
client.channels.get("706363592454176818").setName(`Servers: ${client.guilds.size}/100`);
3334
});
3435

35-
client.on("guildDelete", () => {
36+
client.on("guildDelete", (guild) => {
37+
console.log(`[GUILD_DELETE]: Removed from ${guild.name}.`);
3638
client.channels.get("706363592454176818").setName(`Servers: ${client.guilds.size}/100`);
3739
});
3840

41+
/*
42+
client.on("raw", (raw) => {
43+
console.log(raw);
44+
});
45+
*/
46+
3947
client.on('message', async (message) => {
48+
49+
if (message.content === "emit") {
50+
message.reply("Emitted");
51+
client.emit("guildDelete", message.guild);
52+
};
4053
// ignore messages without prefixes and messages from the bot itself
4154
if (!message.content.startsWith(prefix) || message.author.bot) return;
4255

@@ -57,5 +70,12 @@ client.on('message', async (message) => {
5770
}
5871
});
5972

73+
client.on("error", (error) => {
74+
// 706367586039889920
75+
const embed = new Discord.RichEmbed();
76+
embed.setColor("RED");
77+
embed.addField("Error", 'boomer???');
78+
client.channels.get("706367586039889920").send({embed});
79+
});
6080
// login to Discord with your app's token
6181
client.login(token);

0 commit comments

Comments
 (0)