Skip to content

Commit

Permalink
Primeiras atualizações de discord.js e alterar a licença para GNU
Browse files Browse the repository at this point in the history
  • Loading branch information
euandrelucas committed Mar 15, 2022
1 parent b03cc1d commit 940c392
Show file tree
Hide file tree
Showing 105 changed files with 1,145 additions and 930 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ src/db/giveaways.json

## CONFIDENCIAL files

/backups
src/Archive
src/Client/Plugins/nodes.js
src/Config/player.js
Expand Down
875 changes: 674 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"canvas": "2.8.0",
"colors": "^1.4.0",
"deepai": "^1.0.17",
"discord-backup": "^3.0.1",
"discord-giveaways": "^5.1.1",
"discord.js": "^13.6.0",
"eris": "0.16.1",
"eris-collector": "^1.0.1",
"eris-giveaways": "^1.0.3",
"express": "^4.17.2",
"math-expression-evaluator": "^1.3.8",
"moment": "^2.29.1",
Expand Down
10 changes: 5 additions & 5 deletions src/Client/Plugins/lavalinkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,34 @@ global.zuly.music = new Manager({
status: !1
});
}).on('trackStart', async (player, track) => {
const ch = await global.zuly.getRESTChannel(player.textChannel);
const ch = await global.zuly.channels.cache.get(player.textChannel);
let idioma = require('../../Config/idiomas.js');
let lang = await global.zuly.db.get(`idioma-${ch.guild.id}`) || 'pt_br';
lang = lang.replace(/-/g, '_');
idioma = idioma[lang];
const embed = new global.zuly.manager.Ebl();
embed.setDescription(`<:zu_mp3:882310253226635284> **|** ${idioma.erela.np} **${track.title}**`);
embed.setColor('#ffcbdb');
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.avatarURL);
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
ch.createMessage({
embeds: [embed.get()]
});
}).on('queueEnd', async (player) => {
const ch = await global.zuly.getRESTChannel(player.textChannel);
const ch = await global.zuly.channels.cache.get(player.textChannel);
let idioma = require('../../Config/idiomas.js');
let lang = await global.zuly.db.get(`idioma-${ch.guild.id}`) || 'pt_br';
lang = lang.replace(/-/g, '_');
idioma = idioma[lang];
const embed = new global.zuly.manager.Ebl();
embed.setDescription(`<:zu_mp3:882310253226635284> **|** ${idioma.erela.end}`);
embed.setColor('#ffcbdb');
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.avatarURL);
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
ch.createMessage({
embeds: [embed.get()]
});
player.destroy();
}).on('playerMove', async (player, currentChannel, newChannel) => {
player.voiceChannel = await global.zuly.getRESTChannel(newChannel);
player.voiceChannel = await global.zuly.channels.cache.get(newChannel);
}).on('socketClosed', (player, payload) => {
if (payload.byRemote == true) {
player.destroy();
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Anime/RandomAnimeCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = class RandomAnimeCommand {
embed.setThumbnail(anime.attributes.posterImage.large);
embed.setFooter('⤷ zulybot.xyz');
ctx.message.channel.slashReply({
content: ctx.message.author,
content: ctx.message.author.mention,
embeds: [embed.get()]
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Config/AntiNSFW.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class LangCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -43,13 +43,13 @@ module.exports = class LangCommand {
if (nsfw) {
await global.zuly.db.delete(`nsfw-${ctx.message.guild.id}`);
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.nsfw.desativado}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.nsfw.desativado}`
});
}
else {
await global.zuly.db.set(`nsfw-${ctx.message.guild.id}`, true);
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.nsfw.ativado}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.nsfw.ativado}`
});
}
}
Expand Down
34 changes: 17 additions & 17 deletions src/Commands/Config/AutoroleCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = class AutoroleCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'addReactions', 'manageMessages']
membro: ['MANAGE_GUILD', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'ADD_REACTIONS', 'manageMessages']
},
pt: {
nome: 'autorole',
Expand Down Expand Up @@ -74,8 +74,8 @@ module.exports = class AutoroleCommand {
// COR DA EMBED
embed.setColor('#ffcbdb');
// CRIANDO OS NEGOCIO
ctx.message.createMessage({
content: ctx.message.author,
ctx.message.editReply({
content: ctx.message.author.mention,
embeds: [embed.get()]
}).then(msg => {
// ADICIONANDO REAÇÕES
Expand Down Expand Up @@ -116,8 +116,8 @@ module.exports = class AutoroleCommand {
bot.on('collect', () => {
msg.delete();
// INICIANDO COLETOR
ctx.message.createMessage({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.autorole.bot}`
ctx.message.editReply({
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.autorole.bot}`
}).then(m => {
const mcol = new MessageCollector(m.channel, {
user: ctx.message.author,
Expand All @@ -134,11 +134,11 @@ module.exports = class AutoroleCommand {
// EMBED DE AUTOROLE-BOT
const embed2 = new global.zuly.manager.Ebl();
embed2.setTitle(`📋 Autorole | ${global.zuly.user.username}`);
embed2.setDescription(`:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.autorole.botset} ${addrole.map((rolee) => `<@&${rolee}>`).join(', ')}`);
embed2.setDescription(`:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.autorole.botset} ${addrole.map((rolee) => `<@&${rolee}>`).join(', ')}`);
embed2.setColor('#ffcbdb');
// ENVIANDO A EMBED E CRIANDO AS COISAS
ctx.message.createMessage({
content: ctx.message.author,
ctx.message.editReply({
content: ctx.message.author.mention,
embeds: [embed2.get()]
});
if (!autorolebot) {
Expand All @@ -163,8 +163,8 @@ module.exports = class AutoroleCommand {
user.on('collect', () => {
msg.delete();
// INICIANDO COLETOR
ctx.message.createMessage({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.autorole.user}`
ctx.message.editReply({
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.autorole.user}`
}).then(m => {
const mcol = new MessageCollector(m.channel, {
user: ctx.message.author,
Expand All @@ -181,11 +181,11 @@ module.exports = class AutoroleCommand {
// EMBED DE AUTOROLE-USER
const embed3 = new global.zuly.manager.Ebl();
embed3.setTitle(`📋 Autorole | ${global.zuly.user.username}`);
embed3.setDescription(`:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.autorole.userset} ${addrole.map((rolee) => `<@&${rolee}>`).join(', ')}`);
embed3.setDescription(`:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.autorole.userset} ${addrole.map((rolee) => `<@&${rolee}>`).join(', ')}`);
embed3.setColor('#ffcbdb');
// ENVIANDO A EMBED E CRIANDO AS COISAS
ctx.message.createMessage({
content: ctx.message.author,
ctx.message.editReply({
content: ctx.message.author.mention,
embeds: [embed3.get()]
});
if (!autoroleuser) {
Expand Down Expand Up @@ -213,10 +213,10 @@ module.exports = class AutoroleCommand {
// EMBED DE AUTOROLE-DELETED
const delb = new global.zuly.manager.Ebl();
delb.setTitle(`📋 Autorole | ${global.zuly.user.username}`);
delb.setDescription(`:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.autorole.disabled}`);
delb.setDescription(`:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.autorole.disabled}`);
delb.setColor('#ffcbdb');
return ctx.message.createMessage({
content: ctx.message.author,
return ctx.message.editReply({
content: ctx.message.author.mention,
embeds: [delb.get()]
}).then(() => {
msg.delete();
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Config/CustomCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class LangCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = class LangCommand {
const command = await global.zuly.commands.get(nome);
if (command) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.alreadyExists}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.alreadyExists}`
});
}
await global.zuly.requestHandler.request('POST', `/applications/${global.zuly.user.id}/guilds/${ctx.message.guild.id}/commands`, true, {
Expand All @@ -71,7 +71,7 @@ module.exports = class LangCommand {
description: `[🌀 » Custom] ${ctx.args[1] || 'No Description'}`,
});
ctx.message.channel.slashReply({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.customCommand}`.replace('%n', nome)
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.customCommand}`.replace('%n', nome)
}).then(async () => {
await global.zuly.db.set(`custom-command-${nome}-${ctx.message.guild.id}`, ctx.args[2]);
});
Expand Down
10 changes: 5 additions & 5 deletions src/Commands/Config/FNShopCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class LangCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -46,23 +46,23 @@ module.exports = class LangCommand {
async run (ctx) {
if (!ctx.args[0]) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.fnshop.args}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.fnshop.args}`
});
}
const fnshop = await global.zuly.db.get(`fnshop-${ctx.message.guild.id}`);
if (!fnshop) {
const canal = await global.zuly.getRESTChannel(ctx.args[0].replace(/<#/g, '').replace(/>/g, ''));
const canal = await global.zuly.channels.cache.get(ctx.args[0].replace(/<#/g, '').replace(/>/g, ''));
try {
canal.createMessage('<a:zu_fortnite:894977940926910485> **|** https://fn.zulybot.xyz/shop-now.png').then(async () => {
await global.zuly.db.set(`fnshop-${ctx.message.guild.id}`, canal.id);
ctx.message.channel.slashReply({
content: `✅ ${ctx.message.author} **|** ${ctx.idioma.fnshop.sucess}`
content: `✅ ${ctx.message.author.mention} **|** ${ctx.idioma.fnshop.sucess}`
});
});
}
catch (e) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.fnshop.channel}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.fnshop.channel}`
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Config/LangCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class LangCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -64,7 +64,7 @@ module.exports = class LangCommand {

if (!ctx.args[0]) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.multiLang.insertLang}`.replace('%p', ctx.prefix).replace('%langs', langs.join(', '))
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.multiLang.insertLang}`.replace('%p', ctx.prefix).replace('%langs', langs.join(', '))
});
}

Expand All @@ -76,7 +76,7 @@ module.exports = class LangCommand {
});

if (langSelecionada == null) {
return ctx.message.channel.slashReply(`:x: ${ctx.message.author} **|** ${ctx.idioma.multiLang.unknownLanguage}`.replace('%langs', '`' + langs.join(', ') + '`'));
return ctx.message.channel.slashReply(`:x: ${ctx.message.author.mention} **|** ${ctx.idioma.multiLang.unknownLanguage}`.replace('%langs', '`' + langs.join(', ') + '`'));
}
else {
switch (langSelecionada) {
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Config/LogsCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class LangCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -46,11 +46,11 @@ module.exports = class LangCommand {
}

async run (ctx) {
const canal = await global.zuly.getRESTChannel(ctx.args[0].replace(/<#/g, '').replace(/>/g, ''));
const canal = await global.zuly.channels.cache.get(ctx.args[0].replace(/<#/g, '').replace(/>/g, ''));
await global.zuly.db.set(`logs-${ctx.message.guild.id}`, canal.id);

ctx.message.channel.slashReply({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.logs.set}`.replace('%c', canal.name)
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.logs.set}`.replace('%c', canal.name)
});
}
};
8 changes: 4 additions & 4 deletions src/Commands/Config/ReactionRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = class ReactionRoleCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'addReactions']
membro: ['MANAGE_GUILD', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'ADD_REACTIONS']
},
pt: {
nome: 'reactionrole',
Expand Down Expand Up @@ -65,12 +65,12 @@ module.exports = class ReactionRoleCommand {
const mensagem = await global.zuly.getMessage(ctx.message.channel.id, message_id);
if (!mensagem) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.reactionRole.invalidMessage.replace('%id%', message_id)}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.reactionRole.invalidMessage.replace('%id%', message_id)}`
});
}
else {
return ctx.message.channel.slashReply({
content: `✅ ${ctx.message.author} **|** ${ctx.idioma.reactionRole.sucess.replace('%id%', message_id)}`
content: `✅ ${ctx.message.author.mention} **|** ${ctx.idioma.reactionRole.sucess.replace('%id%', message_id)}`
}).then(async () => {
await global.zuly.db.set(`reaction-${emojiName}-${message_id}`, role.id);
return mensagem.addReaction(ctx.args[2].replace(/<a:/g, '').replace(/>/g, '').replace(/<:/g, ''));
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Config/TicketSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = class TicketCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['MANAGE_GUILD'],
bot: []
},
pt: {
Expand Down Expand Up @@ -40,7 +40,7 @@ module.exports = class TicketCommand {

async run (ctx) {
ctx.message.channel.slashReply({
content: `✅ ${ctx.message.author} **|** ${ctx.idioma.ticket.sus}`,
content: `✅ ${ctx.message.author.mention} **|** ${ctx.idioma.ticket.sus}`,
flags: ctx.ephemeral
});
global.zuly.createMessage(ctx.message.channel.id, { embed:{
Expand Down
8 changes: 4 additions & 4 deletions src/Commands/Developer/BotbanCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ module.exports = class BanCommand {
let member;
if (!ctx.args[0]) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.ban.noarg}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.ban.noarg}`
});
}

if (!ctx.messages[0]) {
member = await global.zuly.users.fetch(ctx.args[0]).then(info => info).catch(() => {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** Usuário desconhecido.`
content: `:x: ${ctx.message.author.mention} **|** Usuário desconhecido.`
});
});
}
Expand All @@ -86,13 +86,13 @@ module.exports = class BanCommand {
const devs = await global.zuly.db.get('devs');
if (devs.includes(member.id)) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.ban.dev}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.ban.dev}`
});
}
await global.zuly.db.set(`botban-${member.id}`, motivo);

ctx.message.channel.slashReply({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.ban.the} **${member.username}** ${ctx.idioma.ban.foi}`
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.ban.the} **${member.username}** ${ctx.idioma.ban.foi}`
});
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Developer/BotunbanCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ module.exports = class BanCommand {
let member;
if (!ctx.args[0]) {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** ${ctx.idioma.ban.noarg}`
content: `:x: ${ctx.message.author.mention} **|** ${ctx.idioma.ban.noarg}`
});
}

if (!ctx.messages[0]) {
member = await global.zuly.users.fetch(ctx.args[0]).then(info => info).catch(() => {
return ctx.message.channel.slashReply({
content: `:x: ${ctx.message.author} **|** Usuário desconhecido.`
content: `:x: ${ctx.message.author.mention} **|** Usuário desconhecido.`
});
});
}
Expand All @@ -86,7 +86,7 @@ module.exports = class BanCommand {
await global.zuly.db.delete(`botban-${member.id}`);

ctx.message.channel.slashReply({
content: `:white_check_mark: ${ctx.message.author} **|** ${ctx.idioma.ban.the} **${member.username}** ${ctx.idioma.ban.foi}`
content: `:white_check_mark: ${ctx.message.author.mention} **|** ${ctx.idioma.ban.the} **${member.username}** ${ctx.idioma.ban.foi}`
});
}
};
Expand Down
Loading

0 comments on commit 940c392

Please sign in to comment.