Skip to content

Commit

Permalink
🥳 | New Game
Browse files Browse the repository at this point in the history
  • Loading branch information
euandrelucas committed Nov 21, 2021
1 parent 03f357f commit aabee8b
Show file tree
Hide file tree
Showing 19 changed files with 492 additions and 159 deletions.
6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added assets/images/badges/bughunter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"deepai": "^1.0.17",
"erela.js": "^2.3.3",
"eris": "0.16.1",
"eris-collector": "^1.0.1",
"express": "^4.17.1",
"humanize-duration": "^3.27.0",
"math-expression-evaluator": "^1.3.8",
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Config/AutoroleCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = class AutoroleCommand {
constructor () {
return {
permissoes: {
membro: ['manageGuild'],
membro: ['manageGuild', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'addReactions', 'manageMessages']
},
pt: {
Expand Down
4 changes: 2 additions & 2 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'],
bot: []
membro: ['manageGuild', 'manageRoles'],
bot: ['manageRoles', 'useExternalEmojis', 'addReactions']
},
pt: {
nome: 'reactionrole',
Expand Down
16 changes: 14 additions & 2 deletions src/Commands/Economy/ProfileCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,23 @@ module.exports = class EvalCommand {
foto.drawImage(background, 0, 0, canvas.width, canvas.height);

const userPremium = await global.zuly.getPremium('doador', user.id);
const bugHunter = await global.zuly.getBugHunter(user.id);

if (userPremium) {
if (bugHunter && userPremium) {
const bug = await loadImage('./assets/images/badges/bughunter.png');
const early = await loadImage('./assets/images/badges/earlysupport.png');
foto.drawImage(early, 650, 60, 50, 45);
foto.drawImage(early, 650, 60, 60, 45);
foto.drawImage(bug, 700, 60, 60, 45);
}
else if (bugHunter) {
const early = await loadImage('./assets/images/badges/bughunter.png');
foto.drawImage(early, 650, 60, 60, 45);
}
else if (userPremium) {
const early = await loadImage('./assets/images/badges/earlysupport.png');
foto.drawImage(early, 650, 60, 60, 45);
}

if (user.username.length > 9) {
foto.font = '17px Dunkin';
}
Expand Down
129 changes: 129 additions & 0 deletions src/Commands/Fun/GuessTheNumberCommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
module.exports = class Nitro {
constructor () {
return {
permissoes: {
membro: ['manageEvents'],
bot: [],
dono: false
},
pt: {
nome: 'guess',
categoria: '⭐ » Diversão',
desc: 'Adivinhe o número é um jogo educacional divertido.'
},
en: {
nome: 'guess',
categoria: '⭐ » Fun',
desc: 'Guess the Number is a fun educational game.'
},
/*
SUB_COMMAND 1 = SubCommand
SUB_COMMAND_GROUP: 2 = SubCommandGroup
STRING: 3 = String
INTEGER: 4 = Any integer between -2^53 and 2^53
BOOLEAN: 5 = True or False
USER: 6 = User Mention
CHANNEL: 7 = Includes all channel types + categories
ROLE: 8 = Role Mention
MENTIONABLE: 9 = Includes users and roles
NUMBER: 10 = Any double between -2^53 and 2^53
*/
options: [
{
type: 3,
name: 'min',
description: 'The minimum number.',
required: false,
},
{
type: 3,
name: 'max',
description: 'The maximum number.',
required: false,
}
],
aliases: [],
run: this.run
};
}

async run (ctx) {
if (!ctx.args[0] && !ctx.args[1] || isNaN(ctx.args[0]) && isNaN(ctx.args[1])) {
const number = Math.floor(Math.random() * 1500) + 500;
console.log(number);
ctx.message.channel.slashReply({
content: `⏰ ${ctx.message.author.mention} **|** ${ctx.idioma.guess.start.replace('%min', 500).replace('%max', 1500)}`
});
setTimeout(() => {
ctx.message.channel.createMessage({
content: `✅ ${ctx.message.author.mention} **|** ${ctx.idioma.guess.started}`
}).then(async msg => {
const dm = await ctx.message.author.getDMChannel();
dm.createMessage({
content: `👀 ${ctx.message.author.mention} **|** ${ctx.idioma.guess.number.replace('%num', number)}`
}).catch(() => {
ctx.message.createFollowup({
content: `👀 ${ctx.message.author.mention} **|** ${ctx.idioma.guess.number.replace('%num', number)}`,
flags: ctx.ephemeral
});
});
const { MessageCollector } = require('eris-collector');
const collector = new MessageCollector(global.zuly, msg.channel, (m) => m.content === `${number}`, {
time: 300000
});
collector.on('collect', async msg => {
ctx.message.channel.createMessage({
content: `✅ ${msg.author.mention} **|** ${ctx.idioma.guess.win.replace('%num', number)}`,
messageReference: {
channelID: msg.channel.id,
guildID: msg.channel.guild.id,
messageID: msg.id
}
}).then(() => {
collector.stop();
});
});
});
}, 5000);
}
else {
const number = Math.floor(Math.random() * Number(ctx.args[1])) + Number(ctx.args[0]);
console.log(number);
ctx.message.channel.slashReply({
content: `⏰ ${ctx.message.author.mention} **|** ${ctx.idioma.guess.start.replace('%min', Number(ctx.args[0])).replace('%max', Number(ctx.args[1]))}`
});
setTimeout(() => {
ctx.message.channel.createMessage({
content: `✅ ${ctx.message.author.mention} **|** ${ctx.idioma.guess.started}`
}).then(async msg => {
const dm = await ctx.message.author.getDMChannel();
dm.createMessage({
content: `👀 ${ctx.message.author.mention} **|** ${ctx.idioma.guess.number.replace('%num', number)}`
}).catch(() => {
ctx.message.createFollowup({
content: `👀 ${ctx.message.author.mention} **|** ${ctx.idioma.guess.number.replace('%num', number)}`,
flags: ctx.ephemeral
});
});
const { MessageCollector } = require('eris-collector');
const collector = new MessageCollector(global.zuly, msg.channel, (m) => m.content === `${number}`, {
time: 300000
});
collector.on('collect', async msg => {
ctx.message.channel.createMessage({
content: `✅ ${msg.author.mention} **|** ${ctx.idioma.guess.win.replace('%num', number)}`,
messageReference: {
channelID: msg.channel.id,
guildID: msg.channel.guild.id,
messageID: msg.id
}
}).then(() => {
collector.stop();
});
});
});
}, 5000);
}
}
};
// 𝖽
25 changes: 25 additions & 0 deletions src/Commands/Info/BotinfoCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@ module.exports = class BotinfoCommand {
ctx.message.channel.slashReply({
content: ctx.message.author.mention,
embeds: [embed.get()],
components: [
{
type: 1,
components: [
{
type: 2,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
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.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
]
}
]
});
});
}
Expand Down
75 changes: 75 additions & 0 deletions src/Commands/Info/HelpCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,31 @@ module.exports = class Ajuda {
return ctx.message.channel.slashReply({
content: ctx.message.author.mention,
embeds: [help.get()],
components: [
{
type: 1,
components: [
{
type: 2,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
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.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
]
}
],
flags: ctx.ephemeral
});
}
Expand Down Expand Up @@ -116,6 +141,31 @@ module.exports = class Ajuda {
ctx.message.channel.slashReply({
content: ctx.message.author.mention,
embeds: [embed.get()],
components: [
{
type: 1,
components: [
{
type: 2,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
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.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
]
}
],
flags: ctx.ephemeral
});

Expand Down Expand Up @@ -172,6 +222,31 @@ module.exports = class Ajuda {
ctx.message.channel.slashReply({
content: ctx.message.author.mention,
embeds: [embed.get()],
components: [
{
type: 1,
components: [
{
type: 2,
label: `${ctx.idioma.mention.labels.support}`,
style: 5,
url: 'https://discord.gg/pyyyJpw5QW'
},
{
type: 2,
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.mention.labels.website}`,
style: 5,
url: 'https://zulybot.xyz/'
}
]
}
],
flags: ctx.ephemeral
});
break;
Expand Down
20 changes: 19 additions & 1 deletion src/Commands/Info/PingCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,26 @@ module.exports = class PingCommand {
const pingDB = new Promise((r) =>
mongoose.connection.db.admin().ping(() => r(Date.now() - date))
);
const { Constants } = require('eris');
return ctx.message.channel.slashReply({
content: `🏓 **|** ${ctx.message.author.mention} Pong!\n- **API Ping:** \`${global.zuly.shards.random().latency}ms\`\n- **Database:** \`${await pingDB}ms\``
content: `🏓 **|** ${ctx.message.author.mention} Pong!\n- **API Ping:** \`${global.zuly.shards.random().latency}ms\`\n- **Database:** \`${await pingDB}ms\``,
components: [
{
type: Constants.ComponentTypes.ACTION_ROW,
components: [
{
type: Constants.ComponentTypes.BUTTON,
style: Constants.ButtonStyles.PRIMARY,
custom_id: 'ping',
label: ctx.idioma.labels.recalc,
emoji: {
name: '🔁'
},
disabled: false
}
]
}
]
});
}
};
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Utils/UserinfoCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ module.exports = class CalcCommand {
return badges;
}


const user = ctx.args[0] ? ctx.message.mentions[1] || await global.zuly.getRESTUser(ctx.args[0]).catch(() => ctx.message.author) : ctx.message.author;
const badges = getUserBadges(user);
const embed = new ctx.embed();
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Waifu/WaifuCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module.exports = class EvalCommand {
content: ctx.message.author.mention,
embeds: [embed.get()]
}).then(async message => {
console.log(message);
if (!dono) {
const MarryCollector = new ReactionCollector(message, {
user: ctx.message.author,
Expand Down
Loading

0 comments on commit aabee8b

Please sign in to comment.