Use AI to create admirable images to surprise your every morning.
wakeup.mp4
- 🌰 Support multiple image generators, Bing(DALL E3), OpenAI(E2, E3), Baidu.
- 🍏 Support multiple notification channels, Telegram, Slack.
- 🐛 GitHub Action
- 🐕🦺 Support deploy to fly.io
- 🦉 Customizable message format
- 🦟 Auto save logs to GitHub issues
- 🐜 Capture output in GitHub Action
name: wakeuppppp
on:
workflow_dispatch:
jobs:
wakeup:
name: wakeup bot
runs-on: ubuntu-latest
steps:
- name: Wakeup
uses: godruoyi/wekeup@main
with:
tg_token: ${{ secrets.TG_TOKEN }}
tg_chat_id: ${{ secrets.TG_CHAT_ID }}
weather_city: "chongqing"
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
name: wakeuppppp
on:
workflow_dispatch:
jobs:
wakeup:
name: wakeup bot
runs-on: ubuntu-latest
steps:
- name: Wakeup
uses: godruoyi/wekeup@main
with:
# image generator, support [bing_ball_e3, openai, baidu]
# use comma to split multiple
drivers: "bing_ball_e3"
# send message to channels, support [slack, tg]
channels: "slack"
# weather city
weather_city: "chongqing"
# telegram bot config required when use tg channel
tg_token: ${{ secrets.TG_TOKEN }}
tg_chat_id: ${{ secrets.TG_CHAT_ID }}
# slack config required when use Slack channel
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_chat_id: "C0616U4LYHZ"
# openai azure api config
# if you use openai api, only need to set openai_api_key
openai_api_base: "https://godruoyi-openai-azure.openai.azure.com/"
openai_api_type: "azure"
openai_api_version: "2023-06-01-preview"
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
# bing auth token config required when use bing_ball_e3 driver
# bing_auth_token: bing cookie that name is "_U"
# bing_auth_token_kiev: bing cookie that name is "KievRPSAuth"
bing_auth_token: ${{ secrets.BING_AUTH_TOKEN }}
bing_auth_token_kiev: ${{ secrets.BING_AUTH_TOKEN_KIEV }}
# baidu config required when use baidu qianfan driver
# https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Klkqubb9w#%E9%94%99%E8%AF%AF%E7%A0%81
qianfan_ak: ${{ secrets.QIANFAN_AK }}
qianfan_sk: ${{ secrets.QIANFAN_SK }}
# send error message when occur error
send_error: "true"
# message format, available variables:
# {weather} - weather
# {sentence} - today's sentence
# {get_up_time} - get up time
# {error} - error message
# {driver} - generator driver, e.g. openai, bing_ball_e3
# {channel} - notification channel, e.g. tg, telegram, slack
message_format: "今天的天气: {weather}, 起床时间: {get_up_time}\r\n\r\n起床啦,今天又是充满活力的一天,赶紧起来换尿布吧。\r\n\r\n今日诗句: {sentence}\r\n\r\nPowered by {driver}"
error_message_format: "今天的天气: {weather}, 起床时间: {get_up_time}\r\n\r\n起床啦,虽然图片生成失败了,但今天依然是充满活力的一天,。\r\n\r\n今日诗句: {sentence}\r\n\r\n生成图片失败: {error} Driver: {driver}"
- Vist https://bing.com/create and login your Microsoft account(recommend to use GitHub login).
- Open the browser's developer tools and copy the cookie value of
_U
andKievRPSAuth
. - Set the cookie value to GitHub Secrets, the name is
BING_AUTH_TOKEN
andBING_AUTH_TOKEN_KIEV
.
- Get OpenAI API Key from OpenAI dashboard.
- Set the API Key to GitHub Secrets, the name is
OPENAI_API_KEY
.
You can also use Azure API, here are the example:
OPENAI_API_BASE: "https://godruoyi-openai-azure.openai.azure.com/" # change to your azure api base url
OPENAI_API_TYPE: "azure"
OPENAI_API_VERSION: "2023-06-01-preview"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- Get Baidu Qianfan API Key from Baidu Qianfan dashboard.
- Create a new application and make sure you have enabled the
Stable-Diffusion-XL
model. - Set the API Key to GitHub Secrets, the
QIANFAN_AK
is your API Key, theQIANFAN_SK
is your Secret Key.
- Create a new bot with BotFather.
- Get the bot token and set it to GitHub Secrets, the name is
TG_TOKEN
. - Create a new channel and invite the bot to the channel as an administrator.
- Copy the channel id and set it to GitHub Secrets, the name is
TG_CHAT_ID
. - If you don't know how to get the channel id, try to send anything to the JsonDumpBot, it will return the channel id.
- The chat id should be start with
-100
, like-1002002109011
.
- Create a new Slack App with Slack App.
- Go to the
OAuth & Permissions
page and get theBot User OAuth Token
, set it to GitHub Secrets, the name isSLACK_TOKEN
. - Go to the
OAuth & Permissions
scope page and add thechat:write, files:write
scope. - Install the app to your workspace.
- Create a new channel and copy the channel id, set it to GitHub Secrets, the name is
SLACK_CHAT_ID
. - It should be started with
C
, likeC0616U4LYHZ
.
Only support telegram channel now, when you finish the deployed, you should set the telegram bot webhook url to fly.io.
- Create your fly.io account and install flyctl.
- Clone this repository
- Set the necessary environment variables using
flyctl secrets set
command. - Run
flyctl deploy
to deploy. - Get the deployed url and set it to your telegram bot webhook url.
you can use the following command to set the telegram bot webhook url:
# replace {TG_TOKEN} with your telegram bot token
# change the url to your deployed url
curl https://api.telegram.org/bot{TG_TOKEN}/setWebhook?url=https://boootx.fly.dev/webhooks/tg
# verify the webhook url
curl https://api.telegram.org/bot{TG_TOKEN}/getWebhookInfo
now try to send a message that start with /prompt your prompt or anythong
to your bot, it should return an image.
available prompt:
- /prompt
- /prompt_baidu
- /prompt_dall_e2
see demo here: https://t.me/+9F-S1b2qyWEwYTU1
- Install this GitHub Action in your repository, recommend to use your profile repository(such as godruoyi/wakeup.yml).
- Create a GitHub Token
- Install this Shortcuts on your iPhone and set your GitHub Token in the shortcut Dictionary.
- Run it anytime, anywhere.
You can also use CURL to trigger this action, for example:
curl -X POST "https://api.github.com/repos/godruoyi/godruoyi/actions/workflows/wakeup.yml/dispatches" \
--header 'Content-Type: application/json' \
--header 'Authorization: token {GITHUB_TOKEN}' \
--data '{"ref": "master"}'
- @yihong0618
- @BennyThink
- @xenv
- Thank you, that's enough. Just enjoy it.