Retrobot is a Discord bot that allows you to play NES/SNES/GB/GBA games with your friends over chat! Think "TwitchPlaysPokemon", but with GIFs. It accepts button presses, emulates the result, and encodes a GIF to view.
Retrobot simplifies control by auto-forwarding through idle parts of games, such as conversations or battle animations.
Additionally, numbered buttons are added to automatically repeat button presses. This is useful for walking in a specific direction for a long period.
Create a bot in the Discord Developer Portal, and obtain a token for your bot. Also, ensure "Message Content Intent" is enabled for your bot.
Create a file name exactly .env
in your clone of this repository with the following contents:
DISCORD_TOKEN=YOUR DISCORD TOKEN HERE
Run these commands:
yarn install
yarn start
Then invite the bot to a server with the following URL. Be sure to update the OAuth Client ID.
https://discord.com/api/oauth2/authorize?client_id=YOUR_OAUTH_CLIENT_ID_HERE&permissions=68608&scope=bot
Once the bot has joined your Discord server, drop an uncompressed ROM file into a channel. The bot will automatically find the ROM file, and begin emulation. Note: only server "administrators" can start new games.
If you'd like a simple way to run the bot as a background service, there's a helper yarn
script. It will fire up the bot as a background service, and record logs to ./forever/retrobot.log
yarn service:start
And to stop:
yarn service:stop
Requires Docker and Docker Compose is installed on the machine.
- Rename
docker-compose.yml.example
todocker-compose.yml
- Edit
docker-compose.yml
and your Discord bot token. - Run
docker-compose build
- Run
docker-compose up -d
Retrobot is built on libretro
, the code that powers RetroArch. Several libretro
cores have been cross-compiled to WASM to be used in Node.js. Since WASM modules have independent memory spaces, it means several cores of the same type can be instanced. This allows parallelism.
The bot source code here is licensed as MIT. The libretro
core each have their own licenses.