discord-text-games-api
v0.0.21
Published
Discrod Text Games API TypeScript
Downloads
4
Readme
discord-text-games-api
API interfaces for "Discord Text Games" Project.
Used to create text games in Discord.
Ready-to-use game, compatible with Discord Text Games must be in form of ZIP archive, where at root level exists file package.json
with information about the game.
How discord text game creation is done:
- You create main game app JS file (or TS and compile it to JS)
- Your main file must export outside main game plugin class.
- Exported game class must implement GamePluginEntryPoint interface.
- When you have your JS files ready - you need to create game
package.json
file with information about the game. See PackageJsonStructure interface, it describes all required and optional fields. You can combine you npm's package.json with game's package.json and hold all fields in one file. - Now you need to pack you game plugin to ZIP archive. At root level of the archive there must be
package.json
file with game description. It must contain mandatory fieldtextGameEntryPoint
filled with path to main JS file (inside archive). If main game class is not exported via "default" export - thentextGameEntryPoint
additionally should contain name of the class in form:app/app.js#NameOfMainClass
- When your ZIP is ready - you can upload it to Discord server here
If you want require 3rd party library in your plugin - you need pack all dependencies inside your zip (for example, to /node_modules/ subdirectory inside zip). Only next set of dependencies are available without packing: ["fs", "path", "util", "discord-text-games-api"]
See other related repositores:
- discord-text-games-seed Empty project, can be used as starting template.