Coder Social home page Coder Social logo

falcao-g / falgames Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 450 KB

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

JavaScript 100.00%
discord-bot discord-game discord-js discord-lib library minigames

falgames's Issues

2048 doest work

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

Match pairs never timeout

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

Json source for Would you rather

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️⃣');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.