Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
euandrelucas committed Mar 19, 2022
1 parent fa6b7e2 commit d6e6b31
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Dockerfile
## DATABASE FILES

data/base.json
src/db/giveaways.json
/JSON/giveaways.json

## CONFIDENCIAL files

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "zuly",
"version": "3.0",
"description": "Hi, I'm zuly, a just brazilian bot focused on anime!",
"main": "src/zuly.js",
"main": "src/zulyClusters.js",
"scripts": {
"dev": "nodemon",
"start": "node --max_old_space_size=512 --optimize_for_size --expose-gc --gc-interval=1 .",
"forever": "forever -c \"node --max_old_space_size=512 --optimize_for_size --expose-gc --gc-interval=1\" src/zuly.js",
"forever": "forever -c \"node --max_old_space_size=512 --optimize_for_size --expose-gc --gc-interval=1\" src/zulyClusters.js",
"lint": "eslint --fix --ext .js --ignore-path .gitignore ."
},
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Info/BotinfoCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ module.exports = class BotinfoCommand {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down
30 changes: 15 additions & 15 deletions src/Commands/Info/HelpCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ module.exports = class Ajuda {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down Expand Up @@ -152,19 +152,19 @@ module.exports = class Ajuda {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down Expand Up @@ -197,19 +197,19 @@ module.exports = class Ajuda {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down Expand Up @@ -255,19 +255,19 @@ module.exports = class Ajuda {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down Expand Up @@ -334,19 +334,19 @@ module.exports = class Ajuda {
components: [
{
type: 2,
label: `${ctx.idioma.labels.support}`,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${ctx.idioma.labels.invite}`,
label: `${ctx.idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${ctx.idioma.labels.website}`,
label: `${ctx.idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand Down
6 changes: 6 additions & 0 deletions src/Events/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ module.exports = class InteractionEvent {
const { WebhookClient } = require('discord.js');
if (!interaction.isCommand()) return;
await interaction.deferReply();
if (!interaction.guild) {
return interaction.editReply({
content: ':x: **|** Slash commands cannot be used via direct message.',
ephemeral: true
});
};
const blacklist = await global.zuly.db.get(`botban-${interaction.member.user.id}`);
if (blacklist) {
const msg = interaction;
Expand Down
22 changes: 9 additions & 13 deletions src/Events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ module.exports = class MessageCreateEvent {
async run (message) {
const config = require('../Config/config.js');

if (!message.guild.id) {
return message.reply({
content: `:x:`
});
};
if (message.author.bot) return;
if (!message.guild) return;

let idioma = require('../Config/idiomas');
let lang = await global.zuly.db.get(`idioma-${message.guild.id}`) || 'pt_br';
lang = lang.replace(/-/g, '_');
Expand Down Expand Up @@ -44,36 +42,34 @@ module.exports = class MessageCreateEvent {
const mensagens = await global.zuly.db.get(`messages-${message.guild.id}-${message.author.id}`);
await global.zuly.db.set(`messages-${message.guild.id}-${message.author.id}`, mensagens ? mensagens + 1 : 1);

if (message.author.bot) return;

if (message.content === `<@${global.zuly.user.id}>` || message.content === `<@!${global.zuly.user.id}>`) {
const embed = new global.zuly.manager.Ebl();
embed.setAuthor(global.zuly.user.username, '', global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
embed.setDescription(`👋 ${idioma.hello.replace('%user', message.author)}\n> <:zu_info:911303533859590144> ${idioma.about}\n> <:zu_slash:886681118470987967> ${idioma.help}`);
embed.setDescription(`👋 ${idioma.mention.hello.replace('%user', message.author)}\n> <:zu_info:911303533859590144> ${idioma.mention.about}\n> <:zu_slash:886681118470987967> ${idioma.mention.help}`);
embed.setColor('#ffcbdb');
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
message.channel.send({
content: message.author,
content: message.author.mention,
embeds: [embed.get()],
components: [
{
type: 1,
components: [
{
type: 2,
label: `${idioma.labels.support}`,
label: `${idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
label: `${idioma.labels.invite}`,
label: `${idioma.mention.labels.invite}`,
style: 5,
url: 'https://discord.com/oauth2/authorize?client_id=' + global.zuly.user.id + '&scope=bot%20applications.commands&permissions=268823622'
},
{
type: 2,
label: `${idioma.labels.website}`,
label: `${idioma.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
Expand All @@ -100,7 +96,7 @@ module.exports = class MessageCreateEvent {
embed.setThumbnail(global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
embed.setFooter('⤷ zulybot.xyz', global.zuly.user.displayAvatarURL({ dynamic: true, format: 'png', size: 4096 }));
message.channel.send({
content: message.author,
content: message.author.mention,
embeds: [embed.get()]
});
}
Expand Down
11 changes: 5 additions & 6 deletions src/Events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ module.exports = class ReadyEvent {
game: global.zuly.user.username,
type: 5
});
const {
version
} = require('../../package.json');

const adg = await global.zuly.users.fetch('726449359167684734');
const status = [`zulybot.xyz | ${global.zuly.user.username} [v${version}]`, `I'm on ${global.zuly.guilds.cache.size} servers | ${global.zuly.user.username} [v${version}]`, `Follow me on twitter @ZulyBot | ${global.zuly.user.username} [v${version}]`, `/help | ${global.zuly.user.username} [v${version}]`, `/upvote | ${global.zuly.user.username} [v${version}]`, `/invite | ${global.zuly.user.username} [v${version}]`, `Join in my support server discord.gg/pyyyJpw5QW | ${global.zuly.user.username} [v${version}]`, `I was created by: ${adg.username}#${adg.discriminator}`];
const status = [`zulybot.xyz | ${global.zuly.user.username} [v${global.zuly.version}]`, `I'm on ${global.zuly.guilds.cache.size} servers | ${global.zuly.user.username} [v$global.zuly.version]`, `Follow me on twitter @ZulyBot | ${global.zuly.user.username} [v$global.zuly.version]`, `/help | ${global.zuly.user.username} [v$global.zuly.version]`, `/upvote | ${global.zuly.user.username} [v$global.zuly.version]`, `/invite | ${global.zuly.user.username} [v$global.zuly.version]`, `Join in my support server discord.gg/pyyyJpw5QW | ${global.zuly.user.username} [v$global.zuly.version]`, `I was created by: ${adg.username}#${adg.discriminator}`];
const presence = ['online', 'idle', 'dnd'];

setInterval(async () => {
global.zuly.user.setStatus(presence[Math.floor(Math.random() * presence.length)]);
global.zuly.user.setActivity(status[Math.floor(Math.random() * status.length)], {
game: global.zuly.user.username,
name: status[Math.floor(Math.random() * status.length)],
game: status[Math.floor(Math.random() * status.length)],
type: 5
});
}, 1000 * 180);

require('../Integrations/app');
}
};
5 changes: 0 additions & 5 deletions src/ZulyUtilLoader.js

This file was deleted.

1 change: 0 additions & 1 deletion src/db/giveaways.json

This file was deleted.

28 changes: 16 additions & 12 deletions src/zuly.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,29 @@ const client = new Client({
]
});

client.giveawaysManager = new GiveawaysManager(client, {
storage: './src/db/giveaways.json',
updateCountdownEvery: 5000,
default: {
botsCanWin: false,
embedColor: '#FFCBDB',
embedColorEnd: '#FFCBDB',
reaction: '🎁'
}
});

// Games
client.snakecord = new SnakeGame({
title: 'SnakeCord | Zuly',
color: '#ffcbdb',
timestamp: false,
gameOverTitle: 'Fim do Jogo',
});

// Plugins
client.restAPI = new REST({ version: '9' }).setToken(token);
client.routes = require('discord-api-types/v9').Routes;
client.backup = require('discord-backup');
client.version = require('../package.json').version;
client.giveawaysManager = new GiveawaysManager(client, {
storage: './JSON/giveaways.json',
updateCountdownEvery: 5000,
default: {
botsCanWin: false,
embedColor: '#FFCBDB',
embedColorEnd: '#FFCBDB',
reaction: '🎁'
}
});
// Collections
client.commands = new Collection();
client.events = new Collection();
Expand All @@ -71,4 +72,7 @@ client.topgg = new AutoPoster(top.gg.token, client).on('posted', () => {
global.zuly = client;
global.zuly.manager = ZulyBot;

require('./ZulyUtilLoader');
require('./Client/Handler/eventos');
require('./Database/DatabaseConnect');
require('./Utils/ZulyFunctions');
require('./Containers/Premium/bot');

0 comments on commit d6e6b31

Please sign in to comment.