0xGizmolab / djs-games

A package for discord.js mini games which can be used in your bots
https://docs.gizmolab.xyz/npm/games
MIT License
43 stars 10 forks source link

Snake game is just a wall of undefined #15

Closed nigel12341 closed 2 years ago

nigel12341 commented 2 years ago

image

code:

const { SnakeGame } = require('djs-games')

module.exports = {
    name: "snake",
    aliases: [],
    cooldowns: 5000,
    description: "Met dit command kun je het spel snake spelen",
    usage: "",
    toggleOff: true,
    developersOnly: true,
    userpermissions: ["SEND_MESSAGES", "VIEW_CHANNEL"],
    botpermissions: ["SEND_MESSAGES", "MANAGE_MESSAGES", "VIEW_CHANNEL"],

    run: async (client, message, args) => {
        const game = new SnakeGame({
            message: message,
            buttons: true, // If you want to use buttons || False if you want to use reactions
            snake: '🟩',
            apple: '🍎',
            embedColor: 'RANDOM',
            leftButton: '⬅',
            rightButton: '➡',
            upButton: '⬆',
            downButton: '⬇',
        })
        game.start()
    },
};
sarptekbas commented 2 years ago

Try this

const game = new SnakeGame({
  message: message,
  buttons: true, // If you want to use buttons || False if you want to use reactions
  snake: '🟩',
  apple: '🍎',
  board: "⬛",
  embedColor: 'RANDOM',
  leftButton: '⬅',
  rightButton: '➡',
  upButton: '⬆',
  downButton: '⬇'
})
game.start()
DodoGames7 commented 2 years ago

i have opened a pull request to fix this in their docs, hopefully it will get approved

gizmo-dev commented 2 years ago

heya! Thanks for this! we'll update it!

gizmo-dev commented 2 years ago

Its Has been approved! Thank you @DodoGames7 for the contribution! :)