Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E yu m coder main #49

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4209494
Comments added
eYuM-coder Sep 23, 2022
bf41018
Merge branch 'main' of https://github.com/Pogy-Bot/Pogy
eYuM-coder Sep 23, 2022
e795091
Added new command for Pogy
eYuM-coder Oct 4, 2022
d5ee927
Merge branch 'main' of https://github.com/Boeing-737-800/Pogy-1
eYuM-coder Oct 4, 2022
a37f1c9
Added Hack Command For Pogy (bugs fixed)
eYuM-coder Oct 4, 2022
9cbc416
Merge branch 'main' of https://github.com/Boeing-737-800/Pogy-1
eYuM-coder Oct 4, 2022
ca28247
Slash Command support
eYuM-coder Nov 10, 2022
e9bb3df
Slash Command Support for Pogy
eYuM-coder Nov 10, 2022
982dae5
Merge branch 'main' of https://github.com/Boeing-737-800/Pogy-1
eYuM-coder Nov 10, 2022
3fafc4b
Merge branch 'main' of https://github.com/Boeing-737-800/Pogy-1
eYuM-coder Nov 10, 2022
73c826b
Merge branch 'main' of https://github.com/Boeing-737-800/Pogy-1
eYuM-coder Nov 10, 2022
6c17c2a
Slash Commands For Pogy with Raw djs
eYuM-coder Nov 10, 2022
6305dd9
More slash commands for pogy (Plus new handler)
eYuM-coder Nov 17, 2022
d096515
Resolved merge conflicts
eYuM-coder Nov 17, 2022
2b8bede
Delete mute.js
eYuM-coder Nov 18, 2022
0817ab9
Delete unmute.js
eYuM-coder Nov 18, 2022
27b3635
New command for pogy
eYuM-coder Nov 18, 2022
efc8ec2
Why..
eYuM-coder Nov 18, 2022
749f04b
Quick fix in warnings.js
eYuM-coder Nov 28, 2022
5da539a
Warn command converted to slash command
eYuM-coder Nov 28, 2022
e0f2418
Another command
eYuM-coder Nov 28, 2022
0624100
New category :D
eYuM-coder Feb 15, 2023
98b246d
Create balance.js
eYuM-coder Feb 15, 2023
7c1ff75
Create beg.js
eYuM-coder Feb 15, 2023
f6fa81b
Deleted this.
eYuM-coder Feb 15, 2023
83098c4
Create e
eYuM-coder Feb 15, 2023
f649917
New category :D
eYuM-coder Feb 15, 2023
06f17e3
Delete e
eYuM-coder Feb 15, 2023
9ae63fa
Added profile.js
eYuM-coder Feb 15, 2023
83813a9
Update utils.js
eYuM-coder Feb 15, 2023
bc198ca
Finished information category
eYuM-coder Mar 6, 2023
fe4d39c
finished moderation category
eYuM-coder Mar 6, 2023
b8b7ec2
Create autoresponselist.js
eYuM-coder Mar 6, 2023
e1de5e8
finished config category
eYuM-coder Mar 6, 2023
effd7e0
Create quote.js
eYuM-coder Mar 6, 2023
b435373
finishing this later
eYuM-coder Mar 6, 2023
7fe5c22
Create addbadge.js
eYuM-coder Mar 6, 2023
bc560bf
unfinished
eYuM-coder Mar 6, 2023
fb8a6d0
Create vote.js
eYuM-coder Mar 6, 2023
9e3259a
Unfinished (still have a lot to convert here)
eYuM-coder Mar 6, 2023
21bf2d5
Merge branch 'Pogy-Bot:main' into main
eYuM-coder Mar 9, 2023
4c9061d
Changed url to hcaptcha api
eYuM-coder Mar 9, 2023
af83ab2
Update clear.js
eYuM-coder Mar 10, 2023
6fe459b
added say slash command!
hotsu0p Dec 24, 2023
fff4773
yea ig
hotsu0p Dec 24, 2023
8e516b1
added users
hotsu0p Dec 24, 2023
861ac97
added fule
hotsu0p Dec 24, 2023
269d22a
✨commands page
hotsu0p Dec 31, 2023
eb632e5
removed somethings
hotsu0p Dec 31, 2023
21a2247
few things
hotsu0p Dec 24, 2023
967766f
Addded new page and yea
hotsu0p Dec 31, 2023
6f9a28a
minor update
Jan 3, 2024
4d77daa
Create config.json
eYuM-coder Jan 3, 2024
7b25825
Merge pull request #1 from eYuM-coder/eYuM-coder-patch-1
eYuM-coder Jan 3, 2024
9ceab9f
update
Jan 3, 2024
61dfde2
a
Jan 3, 2024
49d12f4
Slash Commands Update
Jan 3, 2024
bf65133
added and removed stuff
hotsu0p Jan 4, 2024
4f64c28
update language files for better grammar
Jan 4, 2024
f34e1f9
minor website update
Jan 4, 2024
05e99e7
a
Jan 4, 2024
5a1b632
Slash command update
Jan 4, 2024
911643c
few commits. added change log page
hotsu0p Jan 5, 2024
d95d83f
more updates
Jan 5, 2024
304dfc2
updated readme and gitignore
hotsu0p Jan 5, 2024
753def0
THIS ISNT FINISHED
hotsu0p Jan 7, 2024
73c5286
added small little things
hotsu0p Jan 7, 2024
0735d62
:sparkles: new stuff?
hotsu0p Jan 7, 2024
fb52050
Finnal command for now
hotsu0p Jan 7, 2024
f94329f
This is more commands
hotsu0p Jan 8, 2024
b98e84c
updated command
hotsu0p Jan 9, 2024
3b7a0a9
Merge branch 'main' of https://github.com/eYuM-coder/MEE8 into eYuM-c…
hotsu0p Jan 9, 2024
0f64192
Renamed stuff from MEE8 to Pogy
hotsu0p Jan 9, 2024
78c8c86
i added retard things and fixed retart erros . last commit of the day…
hotsu0p Jan 10, 2024
cabaddb
updated level up message to embed
hotsu0p Jan 10, 2024
0a29cbf
Update ig . some dont work and im working on new button things so you…
hotsu0p Jan 10, 2024
a04d5a6
this should work . will add more later. gonna be busu
hotsu0p Jan 10, 2024
5a92507
more updates. calc doesnt relaly work. will fix later
hotsu0p Jan 11, 2024
e9acd41
added cool new help menu button
hotsu0p Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .env.template

This file was deleted.

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ src/assets/logs/Pogy.log
config.json
node_modules
.env
package-lock.json
package-lock.json
src/data/users.json
src/commands/utility/rank.js
src/data/users.json
package-lock.json
config.json
17 changes: 16 additions & 1 deletion .replit
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
language = "nodejs"
run = "npm start"
run = "npm start"

hidden = [".config", "package-lock.json"]
entrypoint = "index.js"
modules = ["nodejs-20:v8-20230920-bd784b9"]

[nix]
channel = "stable-22_11"

[unitTest]
language = "nodejs"

[deployment]
deploymentTarget = "static"
ignorePorts = false
publicDir = "./"
4 changes: 3 additions & 1 deletion Pogy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { Client, Collection } = require("discord.js");
const Util = require("./src/structures/Util");
const config = require("./config.json");
const fs = require("node:fs");
const path = require("node:path");
const { status } = config;

module.exports = class PogyClient extends Client {
Expand Down Expand Up @@ -30,9 +32,9 @@ module.exports = class PogyClient extends Client {
],
},
});

this.validate(options);
this.botCommands = new Collection();
this.slashCommands = new Collection();
this.botEvents = new Collection();
this.aliases = new Collection();
this.utils = require("./src/utils/utils.js");
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
</p>

## Community Updates
[Pogy + More dashboard pages and commands by Hotsuop](https://github.com/hotsu0p/Pogy)

[Pogy + Slash commands by eYuM](https://github.com/Pogy-Bot/Pogy/tree/eyum-contributions)

## About
Expand Down Expand Up @@ -206,11 +208,15 @@ You can launch the bot with `npm start`

Released under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0) license.

## Support
[Click here for the support server](https://v2.pogy.xyz/support)

## Donate

You can donate Pogy and make it stronger than ever [by clicking here](https://paypal.me/pogybot)!

## Credits
[Old Credits](https://github.com/peterhanania/pogy#credits)
- Peter Hanania [DJS Rewrite] - [github.com/peterhanania](github.com/peterhanania)
- JANO [DJS Rewrite] - [github.com/wlegit](github.com/wlegit)
- Peter Hanania [DJS Rewrite] - [github.com/peterhanania](https://github.com/peterhanania)
- JANO [DJS Rewrite] - [github.com/wlegit](https://github.com/wlegit)
- Hotsuop [Added commands & Commands] - [https://github.com/hotsu0p](https://github.com/hotsu0p)
35 changes: 35 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"clientId": "1168994296989483058",
"developers": ["1067137336674107453"],
"status": "!help | website here",
"discord": "https://discord.gg/",
"dashboard": "true",
"server": "",
"prefix": "!",
"webhooks": {
"logs": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"maintenance_logs": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"ratelimit_logs": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"blacklist": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"report": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"contact": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"bugs": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"premium": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"suggestions": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"votes": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"errors": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"auth": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"joinsPublic": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"joinsPrivate": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"leavesPublic": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ",
"leavesPrivate": "https://discord.com/api/webhooks/1188279551881662534/J2qk9kiYkPRrGO9-8CpBd1tR3vDhggcYYsWYvTWcNRPWhsis9GW7vtbm1Kox14OGL7kJ"
},
"maintenance": "false",
"maintenance_threshold": "5",
"invite_link": "https://discord.com/api/oauth2/authorize?client_id=1135714988493910136&permissions=70368744177663&scope=bot+applications.commands",
"seo": {
"enabled": "false",
"title": "Bot Name",
"description": "Bot description"
}
}
34 changes: 0 additions & 34 deletions config.json.template

This file was deleted.

154 changes: 150 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
// Imports lol
require("dotenv").config();
const { MessageEmbed, MessageActionRow , MessageButton} = require('discord.js');
const PogyClient = require("./Pogy");
const config = require("./config.json");
const deploy = require("./src/deployCommands.js");
const path = require("node:path");
const { Collection } = require("discord.js");
const logger = require("./src/utils/logger");
const fs = require("node:fs");
const Pogy = new PogyClient(config);

const { Distube } = require('distube');
const Command = require("./src/structures/Command");
const { Player } = require('discord-player');
const color = require("./src/data/colors");
const Guild = require("./src/database/schemas/Guild");
const { stripIndent } = require("common-tags");
const emojis = require("./src/assets/emojis.json");

Pogy.color = color;

const emoji = require("./src/data/emoji");
Expand All @@ -13,6 +25,142 @@ Pogy.emoji = emoji;
let client = Pogy;
const jointocreate = require("./src/structures/jointocreate");
jointocreate(client);
// end imports

// Load user data from the JSON file
let userData = require('./src/data/users.json');

client.on('messageCreate', message => {
if (message.author.bot) return;

const userId = message.author.id; // Define userId here
if (!userData.users[userId]) {
userData.users[userId] = {
xp: 0,
level: 1,
username: message.author.username // Save the username in the userData
};
}

// If the background URL is not set, save it
if (!userData.users[userId].background) {
userData.users[userId].background = 'https://img.freepik.com/premium-photo/abstract-blue-black-gradient-plain-studio-background_570543-8893.jpg'; // Replace with your default background URL
}

const levelbed = new MessageEmbed()
.setColor(color.blue)
.setTitle('Level Up!')
.setAuthor(message.author.username, message.author.displayAvatarURL())
.setDescription(`You have reached level ${userData.users[userId].level}!`)
.setFooter(`XP: ${userData.users[userId].xp}/${userData.users[userId].level * 75}`)

const row = new MessageActionRow().addComponents(

new MessageButton()
.setCustomId('levelup')
.setLabel('Level Up')
.setStyle('SUCCESS')

)
client.on('interactionCreate', async interaction => {
if (!interaction.isButton()) return;

if (interaction.customId === 'levelup') { // Assuming this is the correct customId
await interaction.reply('Button clicked!');
}
});


// Increment XP for the user
userData.users[userId].xp += 1;

// Check for level-up logic
const xpNeededForNextLevel = userData.users[userId].level * 75;
if (userData.users[userId].xp >= xpNeededForNextLevel) {
userData.users[userId].level += 1;
message.channel.send({embeds : [levelbed], components : [row]});
}

// Save updated data back to the JSON file
fs.writeFile('./src/data/users.json', JSON.stringify(userData, null, 2), err => {
if (err) console.error('Error writing file:', err);
});
});

client.slashCommands = new Collection();
const commandsFolders = fs.readdirSync("./src/slashCommands");

for (const folder of commandsFolders) {
const commandFiles = fs.readdirSync(`./src/slashCommands/${folder}`).filter((file) => file.endsWith(".js"));

for(const file of commandFiles) {
const slashCommand = require(`./src/slashCommands/${folder}/${file}`);
client.slashCommands.set(slashCommand.data.name, slashCommand);
Promise.resolve(slashCommand);
}
}

client.on('interactionCreate', async interaction => {
if(!interaction.isCommand()) return;

const slashCommand = client.slashCommands.get(interaction.commandName);

if (!slashCommand) return;

try {
await slashCommand.execute(interaction);
} catch (error) {
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
});

// mem leak fix
client.setMaxListeners(20);
/*
This is where you should add all button handler stuff
this is the first one i have added
*/
const moreinfo = new MessageEmbed()
.setColor(color.blue)
.setTitle('More Info')
.setURL("https://pogy.xyz/invite")
.setDescription("Pogy is a discord bot with a lot of features. You can invite Pogy to your server by clicking the button below")
.setFooter("Pogy", "https://pogy.xyz/assets/images/pogy.png")
.addField("Invite Pogy", "https://pogy.xyz/invite")
.addField("Support Server", "https://discord.gg/pogy")
.addField("Vote Pogy", "https://top.gg/bot/880243836830652958/vote")

const invitebutton = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel("Invite Pogy")
.setStyle("LINK")
.setURL("https://pogy.xyz/invite"),
)
const infobutton = new MessageEmbed()
.setTitle(`Info`)
.setDescription(" hello there poger. If you want more info on this bot you can check out the github repo or join the support server")
.setURL("https://github.com/hotsu0p/Pogy/")
.addField("Github Repo", "https://github.com/hotsu0p/Pogy/")

client.on('interactionCreate', async interaction => {
if (!interaction.isButton()) return;

try {
if (interaction.customId === 'support') {
await interaction.reply({ embeds: [moreinfo], components: [invitebutton] });
} else if (interaction.customId === 'info') {
await interaction.reply({ embeds: [infobutton] });

} else {
await interaction.reply('Unknown button clicked.');
}
} catch (error) {
console.error('Error handling button interaction:', error);
await interaction.reply({ content: 'An error occurred.', ephemeral: true });
}
});


Pogy.react = new Map();
Pogy.fetchforguild = new Map();
Expand All @@ -36,6 +184,4 @@ process.on("uncaughtExceptionMonitor", (err, origin) => {
process.on("multipleResolves", (type, promise, reason) => {
logger.info(`[multipleResolves] MULTIPLE RESOLVES`, { label: "ERROR" });
console.log(type, promise, reason);
});


});
Loading