I have made a JavaScript game. Now I want to make a Discord bot that embeds it in a message, so a reader can click on the embed to play the game inside the chat. Something similar to this Snake game.
Here's what the result should look like:
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI have made a JavaScript game. Now I want to make a Discord bot that embeds it in a message, so a reader can click on the embed to play the game inside the chat. Something similar to this Snake game.
Here's what the result should look like:
You can't really send a game through Discord unless you are using Discord's API.
Why?
The game shown in the video is coded in JavaScript but is run on the bot server, not on the client. The bot appears to compose an HTML response which is then sent to the client, which is then displayed. They don't "send a JavaScript game". I doubt Discord will ever allow sending actual JavaScript to be executed on the client.
(Vaillancourt told me)
But you can run it in a browser by hosting your game on itch.io and sharing a link to its itch.io page.