@sogni-ai/sogni-sticker-bot
v1.0.0
Published
Telegram and Discord bot for generating Sogni AI stickers
Downloads
68
Readme
Sogni AI Sticker Bot
A battle-tested Telegram and Discord bot for generating AI-powered stickers, powered by Sogni Supernet. This bot will generate images on-demand and convert them into stickers you can easily share.
Sample Stickers
This bot can generate fun, unique stickers via chat prompt:
Chat prompt example
Sticker examples
Want to create sticker packs from a collection of generated stickers? Details in our official documentation.
How It Works
- Users type a command (
!generate <prompt>) in your Telegram/Discord server or DM. - The bot connects to Sogni Supernet to create AI-generated images.
- The images are automatically processed (background removed, etc.) and then returned as stickers!
Why Sogni?
Sogni.ai is an all-in-one AI toolkit that harnesses a high-speed and extremely scalable “Supernet” dedicated to creative AI tasks. By using Sogni, you get:
- Fast, cheap, on-demand image generation.
- Built-in NSFW filtering and safety checks.
- Cross-platform usage (web, mobile, Mac, iOS) with a single account.
- A robust environment that supports concurrency and stable performance.
You’ll need a free Sogni username and password to use this bot. You can create an account:
- In the Sogni Mac Studio Pro or Sogni Pocket (iOS), or
- At the Sogni Web App (click “Sign Up”)
Running Your Own Bot
This bot can run in two modes at once (Telegram and/or Discord). If you only want to run one platform, that’s fine too—just add the corresponding token(s) in the .env. described below.
1. Clone or Download
git clone https://github.com/your-user/sogni-sticker-bot.git
cd sogni-sticker-bot2. Install Dependencies
npm installThis repo is also published on npm as @sogni-ai/sogni-sticker-bot.
3. Set Up Environment Variables
Create a .env file (or use environment variables in your hosting platform) with the following:
TELEGRAM_BOT_TOKEN=xxx
DISCORD_BOT_TOKEN=yyy
SOGNI_USERNAME=mySogniUsername
SOGNI_PASSWORD=mySogniPassword
APP_ID=stickerbot
SOGNI_BOT_DATA_DIR=./data- TELEGRAM_BOT_TOKEN: Provided by @BotFather after creating a Telegram bot.
- DISCORD_BOT_TOKEN: Create a bot in the Discord Developer Portal, then copy the bot token.
- SOGNI_USERNAME & SOGNI_PASSWORD: Your free Sogni account credentials.
- APP_ID: Any string that uniquely identifies your bot. Defaults to “stickerbot,” but you can set any name you like.
- SOGNI_BOT_DATA_DIR: Optional writable directory for bot state like Telegram whitelist/blacklist config. Defaults to the current working directory.
4. Create a Telegram Bot (If You Want Telegram)
- Open BotFather on Telegram.
- Send
/newbotand follow the steps (choose a name, username, etc.). - Copy the HTTP API token it gives you and paste it into your
.envasTELEGRAM_BOT_TOKEN.
5. Create a Discord Bot (If You Want Discord)
- Go to the Discord Developer Portal.
- Create a new application, then go to Bot > Add Bot.
- Copy the Bot Token and paste it into
.envasDISCORD_BOT_TOKEN. - Invite the bot to your server by generating an invite link with the correct scopes and permissions (e.g., “Send Messages”, “Read Message History”, “Attach Files”).
6. Run the Bot
npm startOr if you use PM2:
pm2 start ecosystem.config.jsThat’s it! The bot should connect to both Telegram and Discord if you provided both tokens.
Using the Bot
Telegram:
- Type
!generate <prompt>in your group or in a DM to the bot. - The bot will reply with AI-generated stickers.
- Type
Discord:
- Type
!generate <prompt>in any channel where the bot can read messages. - The bot will DM or respond in the same channel with the generated stickers.
- Type
Repeat: Use
!repeatto generate more images based on your previous prompt, if you want more variations.
Admins in Telegram can use slash commands to manage whitelists and blacklists, e.g.:
/addwhitelist cat,dog/addblacklist spam,scam/listwhitelistand/listblacklist/clearwhitelistand/clearblacklist
These commands ensure only certain words are allowed (or disallowed) in user prompts.
Don’t Want to Host It Yourself?
You can try or use the official Sogni sticker bot instead of running your own:
- Telegram: @SogniAIbot
- Discord: In the official Sogni Community server.
If you’re an admin of your group or server, you can invite the official bot to your community. Then you can set whitelists of words that must be used and blacklists of words that can’t be used, just like you would if you hosted your own.
Contributing
Feel free to open issues or pull requests to improve the code or documentation.
License
MIT License.
Powered by Sogni.ai Supernet.
Contact us on Telegram or Discord for help or suggestions!
