0
\$\begingroup\$

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:

enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ 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. So I don't think what I think you think you want to do is feasible. \$\endgroup\$
    – Vaillancourt
    Aug 15, 2022 at 20:09
  • \$\begingroup\$ well, is there anything else I can do? \$\endgroup\$ Aug 15, 2022 at 21:32
  • \$\begingroup\$ You could try to re-write your game the way both of these folks show in their videos, strictly by using Discord's API, or as it's been suggested on your SO question, host your game on the web, outside of Discord. \$\endgroup\$
    – Vaillancourt
    Aug 15, 2022 at 22:39
  • \$\begingroup\$ ok how could I host it on a website \$\endgroup\$ Aug 15, 2022 at 22:55
  • \$\begingroup\$ and what website platform \$\endgroup\$ Aug 15, 2022 at 22:57

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ Don't worry, it's not weird to answer your own question here. \$\endgroup\$
    – DMGregory
    Aug 17, 2022 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .