Skip to content

Commit

Permalink
Merge pull request #19 from Programador-jr/updates
Browse files Browse the repository at this point in the history
added the logs for bot
  • Loading branch information
Programador-jr authored Aug 14, 2021
2 parents e93c4ae + 0d41a8c commit 6d779e5
Show file tree
Hide file tree
Showing 41 changed files with 2,388 additions and 325 deletions.
2 changes: 2 additions & 0 deletions commands/diversão/ratewaifu.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = {

if(user == 532413362940936213) return message.channel.send(`Sobre ${user}... Eu dou nota **1000** para essa waifu. Se vc procurar definição de perfeição no dicionário aparece ${user}! <:cut1:808444488086847538>`)

if(user == 757434569011232879) return message.channel.send(`Sobre ${user}... Eu dou nota **1000** para essa waifu. Se vc procurar definição de perfeição no dicionário aparece ${user}! <:cut1:808444488086847538>`)

if(user == 765113381094817812) return message.channel.send(`Sobre ${user}... Eu dou nota **1000** para essa waifu. Se vc procurar definição de perfeição no dicionário aparece ${user}! <:cut1:808444488086847538>`)

var list = [
Expand Down
85 changes: 85 additions & 0 deletions commands/games/aki.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
const config = require("../../config.json")
const { prefix } = require('../../config.json');
const emojis = ["👍", "👎", "❔", "🤔", "🙄", "❌"];
const isPlaying = new Set();
const { Client, MessageEmbed } = require("discord.js");
const { Aki } = require("aki-api");

module.exports = {
name: 'aki',
category: 'games',

run: async (client, message, args) => {
if (message.author.bot || !message.guild) return;

if (!message.content.startsWith(prefix + "aki")) return;

if (isPlaying.has(message.author.id)) {
return message.channel.send(":x: | Um jogo já está em andamento..");
}

isPlaying.add(message.author.id);

const aki = new Aki("pt"); // Lista completa de idiomas em: https://github.com/jgoralcz/aki-api

await aki.start();

const msg = await message.channel.send(new MessageEmbed()
.setTitle(`${message.author.username}, Questão ${aki.currentStep + 1}`)
.setColor("#00bfff")
.setDescription(`**${aki.question}**\n${aki.answers.map((an, i) => `${an} | ${emojis[i]}`).join("\n")}`));

for (const emoji of emojis) await msg.react(emoji);

const collector = msg.createReactionCollector((reaction, user) => emojis.includes(reaction.emoji.name) && user.id == message.author.id, {
time: 60000 * 6
});

collector
.on("end", () => isPlaying.delete(message.author.id))
.on("collect", async ({
emoji,
users
}) => {
users.remove(message.author).catch(() => null);

if (emoji.name == "❌") return collector.stop();

await aki.step(emojis.indexOf(emoji.name));

if (aki.progress >= 70 || aki.currentStep >= 78) {

await aki.win();

collector.stop();

message.channel.send(new MessageEmbed()
.setTitle("Este é o seu personagem?")
.setDescription(`**${aki.answers[0].name}**\n${aki.answers[0].description}\nRanking**#${aki.answers[0].ranking}**\n\n[sim (**s**) / não (**n**)]`)
.setImage(aki.answers[0].absolute_picture_path)
.setColor("#00bfff"));

const filter = m => /(sim|não|s|n)/i.test(m.content) && m.author.id == message.author.id;

message.channel.awaitMessages(filter, {
max: 1,
time: 30000,
errors: ["time"]
})
.then(collected => {
const isWinner = /sim|s/i.test(collected.first().content);
message.channel.send(new MessageEmbed()
.setTitle(isWinner ? "Excelente! Acertei mais uma vez" : "Uh. você é o vencedor!")
.setColor("#00bfff")
.setDescription("Eu amo brincar com você"));
}).catch(() => null);

} else {
msg.edit(new MessageEmbed()
.setTitle(`${message.author.username}, Questão ${aki.currentStep + 1}`)
.setColor("#00bfff")
.setDescription(`**${aki.question}**\n${aki.answers.map((an, i) => `${an} | ${emojis[i]}`).join("\n")}`));
}
});
}
}
2 changes: 1 addition & 1 deletion commands/games/hangman.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run: async(client, msg, args) => {
.setDescription(
"Já existe uma instância do jogo rodando neste servidor."
)
.setColor("RANDOM")
.setColor("RED")
);
}

Expand Down
4 changes: 2 additions & 2 deletions commands/games/ppt.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const Discord = require('discord.js');
const default_prefix = require('../../config.json');
const prefix = require('../../config.json');
module.exports = {
name:"ppt",
category:"games",
aliases:["jokenpo", "jokenpô"],
run:async (client, message, args, defaut_prefix) => {
const sp = args.join(" ")
const rand = Math.floor(Math.random() * 6)
if(!args.join(" ")) return message.channel.send(`${message.author}, eu preciso que você escreva algo após o comando \`${default_prefix}ppt <pedra/papel/tesoura>\``)
if(!args.join(" ")) return message.channel.send(`${message.author}, eu preciso que você escreva algo após o comando \`${prefix}ppt <pedra/papel/tesoura>\``)
if(rand === 0 || rand === 1) {
chs = `pedra`
}
Expand Down
21 changes: 21 additions & 0 deletions commands/games/snack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const SnakeGame = require('snakecord');
const Discord = require("discord.js");

const snakeGame = new SnakeGame({
title: 'Jogo da Cobra',
color: "GREEN",
timestamp: true,
gameOverTitle: "Game Over "
});


module.exports = {
name: 'snake',
description: 'none',
category: "Fun",
aliases: ["cobra"],
usage: "snake",
run: async(bot, message, args) => {
snakeGame.newGame(message);
},
};{}
43 changes: 21 additions & 22 deletions commands/games/tictactoe.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const Discord = require('discord.js');
const {MessageEmbed} = require("discord.js");
const config = require("../../config.json");

module.exports = {
name: "tictactoe",
Expand Down Expand Up @@ -65,7 +64,7 @@ module.exports = {
"``` 1 | 2 | 3 \n---|---|-- \n 4 | 5 | 6 \n---|---|-- \n 7 | 8 | 9```"
)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');
const game = await message.channel.send({
embed: gameEmbed
});
Expand Down Expand Up @@ -98,7 +97,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -114,7 +113,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#FFFF00');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -146,7 +145,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -162,7 +161,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -196,7 +195,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -212,7 +211,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -244,7 +243,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -260,7 +259,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -294,7 +293,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -310,7 +309,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -342,7 +341,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -358,7 +357,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');
return message.channel.send({
embed: noAnswerEmbed
});
Expand All @@ -367,7 +366,7 @@ module.exports = {
const winnerEmbed = new MessageEmbed()
.setTitle("Game over!")
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

if (validation[0] === 1 && validation[1] === 1 && validation[2] === 1) {
const win = "%user ganhou essa rodada!".replace("%user", message.author);
Expand Down Expand Up @@ -510,7 +509,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -526,7 +525,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -671,7 +670,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -687,7 +686,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -834,7 +833,7 @@ module.exports = {
.setTitle("Jogo da Velha game")
.setDescription(editedDescription)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('#00BFFF');

await game.edit({
embed: gameEmbed
Expand All @@ -850,7 +849,7 @@ module.exports = {
)
.setDescription(noanswer)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('RED');
return message.channel.send({
embed: noAnswerEmbed
});
Expand Down Expand Up @@ -974,7 +973,7 @@ module.exports = {
"Ninguém ganhou, é empate! A próxima rodada pode ser melhor."
)
.setFooter(`${message.author.username} vs ${mention.user.username}`)
.setColor(config.color);
.setColor('GREEN');

return message.channel.send({
embed: drawEmbed
Expand Down
8 changes: 4 additions & 4 deletions commands/musica/nowplaying.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const functions = require("../../functions")
const functions = require("../../functions")
const config = require("../../config.json")
const Canvas = require('canvas');
const Discord = require("discord.js");
module.exports = {
name: "nowplaying",
category: "MUSIC COMMANDS",
aliases: ["np", "current", "currentsong", "cursong"],
aliases: ["np", "current", "currentsong", "cursong", "pn", "agora"],
useage: "nowplaying",
description: "Shows current song",
run: async (client, message, args) => {
Expand Down Expand Up @@ -68,13 +68,13 @@ module.exports = {


var textString = songtitle.substr(0, 35);
ctx.font = 'bold 40px Genta';
ctx.font = 'bold 35px Genta';
ctx.fillStyle = '#00BFFF';
ctx.fillText(textString, 10 + 192 + 10, 10 + 25);
let textStringt
if (songtitle.length > 40) textStringt = songtitle.substr(35, 32) + "...";
else textStringt = "";
ctx.font = 'bold 35px Genta';
ctx.font = 'b5px Genta';
ctx.fillStyle = '#00BFFF';
ctx.fillText(textStringt, 10 + 192 + 10, 10 + 25 + 40);

Expand Down
6 changes: 3 additions & 3 deletions commands/musica/play.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const functions = require("../../functions")
const functions = require("../../functions")
const config = require("../../config.json")
var {
getData,
Expand All @@ -9,7 +9,7 @@ let deezer = new DeezerPublicApi();
module.exports = {
name: "play",
category: "MUSIC COMMANDS",
aliases: ["p"],
aliases: ["p", "tocar"],
cooldown: 5,
useage: "play <URL/NAME>",
description: "Toca uma música do youtube, soundcloud ou qualquer outra coisa, ou pesquisa ou toca uma lista de reprodução",
Expand Down Expand Up @@ -45,7 +45,7 @@ module.exports = {

//do things for deezer
if (args.join(" ").includes("deezer")) {
//Get album list for the given artist id
// list for the given artist id
let track = args.join(" ").split("/")

track = track[track.length - 1]
Expand Down
2 changes: 1 addition & 1 deletion commands/musica/status.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const functions = require("../../functions")
const functions = require("../../functions")
const config = require("../../config.json")
module.exports = {
name: "status",
Expand Down
Loading

0 comments on commit 6d779e5

Please sign in to comment.