View Code? Open in Web Editor
NEW
Falgames is a powerful npm package designed to help others create awesome discord bots
Home Page: https://www.npmjs.com/package/falgames
License: MIT License
falgames's Introduction
Bot developer | CS undergraduate | Robotics enthusiast | Cat owner | 🐍🤖🐱
- 👨💻 Gabriel Falcão, 18 years
- 📊 I aim to be a data scientist one day
- 🤖 I love building discord bots and studying data structures
- 📚 Currently studying Python, Data Science and Backend development
- 🧠 I'm enthusiastic about robotics and educational programs
- 🌐 I like creating and supporting open source projects
- 💜 I'm always trying to be a reference for everyone in my topics of interest
![My skills and tools: html,css,js,nodejs,typescript,c,cpp,vue,nuxtjs,django,express,netlify,postgres,mongodb,bots,raspberrypi,linux,bash,git,vscode,github,vercel,markdown,arduino,postman](https://camo.githubusercontent.com/982fade88c21589c97f53a4ebe980246e1f326bdcfdd8c52999b5d0f42adf70e/68747470733a2f2f736b696c6c69636f6e732e6465762f69636f6e733f693d70792c68746d6c2c6373732c6a732c6e6f64656a732c747970657363726970742c632c6370702c7675652c6e7578746a732c646a616e676f2c657870726573732c6e65746c6966792c706f7374677265732c6d6f6e676f64622c626f74732c72617370626572727970692c6c696e75782c626173682c6769742c7673636f64652c6769746875622c76657263656c2c6d61726b646f776e2c61726475696e6f2c706f73746d616e267468656d653d6461726b267065726c696e653d3133)
🐦 My Threads on Twitter (PT-BR):
🔍 Programação competitiva (Python)
falgames's People
Contributors
Watchers
falgames's Issues
Description of the bug
There is a small error which cause the Matchpairs game to never time. Here the fix:
const collector = msg.createMessageComponentCollector({ idle: this.options.timeoutTime});
Steps to reproduce
Start the Matchpairs game and wait. It wont timeout.
Media, if necessary
No response
Description
Here a json source for restoring the Would you rather game:
https://github.com/itsbrunodev/party-game-sentences/blob/master/src/json/would-you-rather.json
Possible implementation
/*/* async getWyrQuestion() {
return await fetch('https://api.aniket091.xyz/wyr').then(res => res.json()).then(res => res?.data).catch(e => { return {} });
}*/
async startGame() {
if (this.options.isSlashGame || !this.message.author) {
if (!this.message.deferred) await this.message.deferReply().catch(e => {});
this.message.author = this.message.user;
this.options.isSlashGame = true;
}
const questionDB = JSON.parse(await (fs.readFileSync(path.join(__dirname,"would-you-rather.json"), "utf-8")));
const question_number = Math.floor(Math.random() * questionDB.length)
this.data = {option1 :questionDB[question_number][0], option2: questionDB[question_number][1]}
// this.data = await this.getWyrQuestion();
// if (!this.data.title) return this.sendMessage({ content: this.options.errMessage });
const embed = new EmbedBuilder()
.setColor(this.options.embed.color)
.setTitle(this.options.embed.title)
.setDescription(`1. ${this.data.option1} \n2. ${this.data.option2}`)
.setAuthor({ name: this.message.author.tag, iconURL: this.message.author.displayAvatarURL({ dynamic: true }) })
//.addFields({ name: 'Details', value: `**Title:** ${this.data.title}\n**Author:** ${this.data.author}` })
/* const btn1 = new ButtonBuilder().setStyle(this.options.buttonStyle).setLabel(this.options.buttons.option1).setCustomId('wyr_1').setEmoji('1️⃣');
const btn2 = new ButtonBuilder().setStyle(this.options.buttonStyle).setLabel(this.options.buttons.option2).setCustomId('wyr_2').setEmoji('2️⃣');*/
const btn1 = new ButtonBuilder().setStyle(this.options.buttonStyle).setCustomId('wyr_1').setEmoji('1️⃣');
const btn2 = new ButtonBuilder().setStyle(this.options.buttonStyle).setCustomId('wyr_2').setEmoji('2️⃣');
Description of the bug
The code cant find the images.
It need a small fix:
const imagePath = path.join(__dirname, "..", `images/${imageFilenames[i]}`)
Steps to reproduce
Start the 2048 game
Media, if necessary
No response