Discord bot for xkcd.com comics
xkcdbot-rs supports the following commands:
xkcdbot-rs requires 2 environmental variables tokens/keys.
XKCD_BOT_TOKGOOGLE_SEARCH_KEY
If you don't know how to get these keys, look belowBuild bot image
docker build -t xkcdbot .
Run the bot image
docker run --rm --env-file .env --name xkcdbot xkcdbot
This token is required in order for the program to communicate with discord via a bot.
You can get this token from https://discord.com/developers/applications. Steps are:
Bot tab on the left hand sideAdd BotXKCD_BOT_TOKOAuth2 create an OAuth url with the scope of bot and the permission to send messages
This token is required to search for xkcd comics from key words. The token is not used by this repo, but by the xkcd-utils repo (see https://github.com/Hpmason/xkcd-utils/blob/master/src/search.rs).
You can get a google API key by following: https://cloud.google.com/docs/authentication/api-keys
To give it the proper permissions, enable this api: https://console.cloud.google.com/apis/library/customsearch.googleapis.com
And then make sure to restrict the API key to only be able to use the custom search API from the Credentials dashboard https://console.cloud.google.com/apis/credentials
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Content type
Image
Digest
Size
33.9 MB
Last updated
about 5 years ago
docker pull hpmason/xkcdbot