genmagic-discord
v0.1.1
Published
Self-hosted Discord bot for AI images and video with GenMagic: /image and /video with Nano Banana, GPT Image, FLUX, Veo 3.1, Kling 3.0, Seedance and 90+ more models on one API key. One file, no dependencies.
Maintainers
Readme
genmagic-discord
A Discord bot that makes AI images and short videos with GenMagic: Nano Banana, GPT Image, FLUX, Seedream, Veo 3.1, Kling 3.0, Seedance, Wan and the rest of GenMagic's 90+ image and video models, from /image and /video.
Two ways to use it:
- Add the hosted app (nothing to run): add GenMagic to your server or your account. Each member links their own GenMagic account and pays per generation from their own balance; new accounts get free starter credit. More at genmagic.co/discord.
- Run your own with this package (
npx genmagic-discord): one file, no dependencies, every generation paid from your own GenMagic key.
Run your own
- Create an application at the Discord Developer Portal, add a bot, and copy the application id and public key.
- Get a GenMagic API key at genmagic.co/get-api-key.
- Start the server (Node 20 or later) where Discord can reach it over HTTPS:
DISCORD_PUBLIC_KEY=... DISCORD_APP_ID=... GENMAGIC_API_KEY=... PORT=3000 npx genmagic-discord- In the Developer Portal, set the Interactions Endpoint URL to
https://<your host>/interactions(Discord checks it when you save). - Register the commands once:
DISCORD_APP_ID=... DISCORD_BOT_TOKEN=... npx -p genmagic-discord genmagic-discord-register - Invite the bot with the install link from the portal's Installation page.
/image prompt:<text> [model:<id>] posts the image in the channel. /video prompt:<text> [model:<id>] [seconds:4-10] posts the clip when it is ready (most take under two minutes). Model ids and prices: genmagic.co/models or GET https://genmagic.co/api/v1/models.
The bot answers Discord within its 3-second window with a "thinking" message and replaces it with the result. Requests are verified with Discord's Ed25519 signature; anything unsigned gets 401.
License
MIT
