a discord-based monster catching game engine, used for Lozpekamon on our Discord server
- clone this repo to your computer or server
- open command line from the root of the folder and run
npm install
- create the environment variable
DISCORD_BOT_TOKEN
and set it to your bots token (easiest way to to add it to the .env file) - run
npm start
How to configure the game to create your own monster catching game.
Much of the game can be configured through commands, use /lozpekamon-admin-help
to see a full list.
Various .txt files in the _text
folder contain the text used for game responses. Most files have 1 option per line, and a random one is chosen.
Files starting with response-
are directly used to generate message for the user, and certain keywords are replaced before sending:
- %U - user name
- %M - active monster name
- %B - name of ball
- %G - name of random gang
- %R - synonym for "ran away" (defined in
ran-away-phrases.txt
)
To add a command, create a new javascript file in the ./commands
folder. This file should export a config
object and a execute
function.
An object (json) containing the information used to create the command.
- name - the name of the command, that the user will type in
- description - the description text shown to the user when selecting a command
- type - the type of command, stored in the global
ApplicationCommandType
, eitherChatInput
,User
, orMessage
- options - an array of additional inputs for your command (optional)
The options also have a type which describe what kind of data the user can submit. list of ApplicationCommandOptionTypes
module.exports.config = {
name: 'my-command',
description: 'what my command does',
type: ApplicationCommandType.ChatInput,
options: [
name: 'input name',
type: ApplicationCommandOptionType.String,
description: 'description of input shown to user',
required: true
]
}
More info: Discord API Docs - Application Command Object
A function that should be run when this command is run. Recieves interaction
as the first argument.
module.exports.execute = async function (interaction) {
await interaction.reply('you used a command! good for you!');
}
To add a reaction, create a new javascript file in the ./reactions
folder. This file should export a config
object and a execute
function.
An object (json) containing the information used to listen for the reaction
A function that should be run when this reaction is used. Recieves reaction
and user
as arguments.
module.exports.execute = function (reaction, user) {
console.log('the test reaction was triggered');
}
- emojiId - the discord id # for the emoji
Main goal is to rewrite the legacy code into the newer version, running on discord.js 14.
create new discord.js v14 botimplement real discord commandsimplement reaction systemtransfer over all old commandstransfer over all old reactionstransfer over wild monster appeared systemseparate functions into different filesseparate config data, monster data and user data into separate json files
commands to add:
new monster command, with image upload (popup?)- change emoji server
future goals:
- individual monster owning system
- monster level up system
- monster battle system
- additional data storage options (database)
- high scores list(s) with top trainers/monsters
economy plugin