Home

Awesome

Horrible Dad Jokes Bot

This is a Telegram bot that tells very terrible dad jokes, written for example purposes.

You can check it out here.

It looks like this:

Dad Jokes Bot Image

It uses the following services:

This bot scrapes the interwebs (and pays proper credit to it's creators) for dad jokes. Then allows Telegram users to have some good laughs.

Dependencies

Installation & Deploy

npm i -g serverless
pip install -r requirements.txt -t vendored
gem install contentful_bootstrap
contentful_bootstrap create_space "Dad Jokes" -j bootstrap.json

This will also create your account if you don't have one.

Space ID and CDA Token are included in the output from Contentful Bootstrap, for CMA Token, you should go to https://app.contentful.com/spaces/<YOUR_SPACE_ID>/api/cma_tokens (replace <YOUR_SPACE_ID> with your generated Space ID).

export $(cat .env | xargs)
serverless config credentials -p aws -k $AWS_ACCESS_KEY_ID -s $AWS_SECRECT_ACCESS_KEY
serverless deploy
curl --request POST --url "https://api.telegram.org/bot$TG_BOT_TOKEN/setWebhook" --header 'content-type: application/json' --data '{"url":"<THE_URL_FOR_YOUR_TELEGRAM_ENDPOINT>"}'

Make sure to replace <THE_URL_FOR_YOUR_ENDPOINT> with the URL provided by the serverless deploy command output.

Go to https://app.contentful.com/spaces/<YOUR_SPACE_ID>/settings/webhooks (replace <YOUR_SPACE_ID> with the Space ID in your configuration), and create a webhook indicating your webhook endpoint from the serverless deploy command as the URL. Then select Entry.publish as the only webhook to trigger.

LICENCE

Copyright (c) 2018 David Litvak Bruno - Contentful GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.