Skip to main content

tictactoe

This is an example of tictactoe

TIP

This function has became Promised based and can return the winner <User>

With Customization

const simplydjs = require("simply-djs");

messageCreate Event (tictactoe command)

// messageCreate Event

simplydjs.tictactoe(message, {
xEmoji: "emoji id", //default: โŒ
oEmoji: "emoji id", //default: โญ•
idleEmoji: "emoji id", //default: โž–
embedColor: "hex code", //default: #075FFF
embedFoot: "text for footer" //default: 'Make sure to win ;)'
});
INFO

Without Customization

messageCreate Event (tictactoe command)

// messageCreate event

simplydjs.tictactoe(message);

Returns <User>

  • tictactoe returns the user who won the match. so you can reward them with some money or xp.
TIP

Slash Support.

The package supports Auto Slash Recognition ! So no more slash options.

Slash command format

{
name: 'tictactoe',
description: 'Just a fun TicTacToe. Using simply-djs',
options: [{
name: 'user',
type: 'USER',
description: 'user to compete with in TicTacToe using simply-djs',
required: true,
}],
}

Output

image

Options for tictactoe function

OptionsTypeRequiredDefaultDescription
slashBooleanโœ˜falseSlash Support for the Tictactoe (need to be in a slash command)
resultBtnBooleanโœ˜falseResults will be in buttons not as code blocks

Slash Customization

OptionsTypeRequiredDefaultDescription
userSlashStringโœ˜userCustomize the Slash Option name (user slash option)

Embed

OptionsTypeRequiredDefaultDescription
embedColorHex Codeโœ˜#075FFFColor of the Tictactoe guide embed
embedFootStringโœ˜creditsEmbed Footer when the credits turned off
timeoutEmbedColorHex Codeโœ˜#cc0000Color of the Tictactoe timeout alert embed
creditBooleanโœ˜trueCredit the package

Buttons

OptionsTypeRequiredDefaultDescription
xEmojiEmoji IDโœ˜โŒEmoji for X user [Player 1]
oEmojiEmoji IDโœ˜โญ•Emoji for O user [Player 2]
idleEmojiEmoji IDโœ˜โž–Emoji when the space is not occupied