Skip to content

Tic Tac Toe

Mr5ecret edited this page Jan 20, 2024 · 3 revisions
PΛΞ0NIC Development Banner

🔖 Tic Tac Toe

Simple TicTacToe Game with Discord Buttons

/tictactoe @[user]

Edited: Version 4.2.3


const { TicTacToe } = require('flex-gamecord');

const Game = new TicTacToe({
  message: message,
  isSlashGame: false,
  opponent: message.mentions.users.first(),
  embed: {
    title: 'Tic Tac Toe',
    color: '#5865F2',
    statusTitle: 'Status',
    overTitle: 'Game Over',
    footerEnabled: false,
    footer: {
      text: `PΛΞ0NIC Development`,
      // iconURL: 'someIconURL', // If you want to add iconURL then remove the comment and add working url!
    },
    timestamp: false,
  },
  emojis: {
    xButton: '❌',
    oButton: '🔵',
    blankButton: '➖'
  },
  mentionUser: true,
  timeoutTime: 60000,
  xButtonStyle: 'DANGER',
  oButtonStyle: 'PRIMARY',
  turnMessage: '{emoji} | Its turn of player {player.displayName}.', // {player.tag} {player} {player.displayName} 
  winMessage: '{emoji} | {player.displayName} won the TicTacToe Game.',
  tieMessage: 'The Game tied! No one won the Game!',
  timeoutMessage: 'The Game went unfinished! No one won the Game!',
  playerOnlyMessage: 'Only {player.displayName} and {opponent.displayName} can use these buttons',
});

Game.startGame();
Game.on('gameOver', result => {
  console.log(result);  // =>  { result... }
});

📝 / Slash Commands

message: interaction,
isSlashGame: true,
opponent: interaction.options.getUser('user')

🆕 Updates

*** v4.2.3
+ Added option to disable footer
*** v4.2.1-dev
+ Added footer/timestamp options