This bot integrates with Feishu/Lark and generates images utilizing the Image Creator from Microsoft Bing service.
- /balance Get tokens balance of Bing cookie
- /prompt <Your prompt> Create image with prompt
- /prompt_pro <Your prompt> Create image with prompt revised by GPT
To make your bot accessible online, you can leverage services like ngrok or Cloudflare Tunnel.
- Compile the bot:
go build .
- Initiate a config file from the provided template and modify the
lark_event_server_addr
as needed:cp config.example.json config.json
- (Optional) For Lark users, set config
is_feishu
tofalse
. - Execute the program:
./lark-dalle3-bot
This step ensures that the server is reachable when setting up event subscriptions soon.
- On the Feishu Open Platform, start by creating a custom app.
- In menu
Add features
, activate theBot
feature. - In menu
Permissions & Scopes
, add the followingAPI Scopes
:im:message
im:resource
im:message.group_at_msg:readonly
im:message.p2p_msg:readonly
- In menu
Event Subscriptions
:- Set
Request URL
withhttp(s)://<your domain>:<your port>/dalle3
. - Add the
im.message.receive_v1
event. - Grant these permissions to the new event:
Obtain private messages sent to the bot
Obtain group messages mentioning the bot
- Set
- Publish your app through the
Version Management & Release
tab.
For Lark users, please visit Lark Open Platform.
From the Feishu/Lark Open Platform:
- Acquire the
App ID
andApp Secret
from menuCredentials & Basic Info
. - Acquire the
Encrypt Key
andVerification Token
from menuEvent Subscriptions
.
From Bing:
- Follow the instructions in the README at yihong0618/BingImageCreator to obtain your Bing cookie.
Only for Lark users, please set is_feishu
to false
in config file.
Update your config.json
with these credentials, then rerun your bot and enjoy the magic.
- yihong0618/tg_bing_dalle: A Telegram bot for DALL-E 3 with Bing
- yihong0618/BingImageCreator: High-quality image generation by Microsoft's reverse-engineered API.
Translated by GPT4.
If you use this project for services open to the public in China, you are required to comply with the relevant laws and regulations, and you may need to obtain the necessary permits or complete relevant procedures. This project is only for technical communication and does not assume responsibility for any legal risks that may arise during your use.