Try the official public instance of the bot here: Scripture Bot
Bible Bot, for reading the whole Bible in 80+ translations inside Telegram. You can read the bible, request a passage by sending the reference and customize your experience.
This is a complete re-write and modified version of the previous version: 3, which you can find here: dcdunkan/bible-bot-v3.
Re-written in TypeScript and grammY and now it runs on Deno.
Thanks to these tools and libraries.
- GetBible.net API — A simple API used for fetching the Scripture data for the various translations.
- grammY - The coolest Telegram Bot Framework.
- Read the whole Bible in 80+ translations (Does not require any manual
updating by this bot, it should update as the GetBible API data updates). Use
the
/translations
or/read
command in chat. - Request a passage by sending the reference. You can find the accepted book
names and formats by sending
/valid_references
in chat. - Set a default translation. You don't have to do
/translations
every time and choose one. You can set a default one using/default
. And this will be used when using/read
command and requesting passages. - Bookmarks. Click on the 🔖 button to bookmark a page and ❌🔖 to remove
it. Use
/bookmarks
to list all of your bookmarks. - Customize your experience with the options (You can suggest something new
by opening an issue or by contributing) in the
/settings
menu. - I was reading ABC last day. Ah, use
/last
to get back to the last read page.
I really want to add more features like, using inline to share verses, or something like a verse image generator, maybe? Maybe sometime in future.
Make sure you have installed Deno.
-
Clone the repository.
git clone https://github.com/dcdunkan/bible-bot.git
-
Change directory (
cd
) to the cloned repository. -
Create a
.env
file and set environment variables like in.env.example
. Make sure you have setLOCALLY
to1
. -
Run the bot using the command below.
DEBUG=1 deno -NI -E=DEBUG,BOT_TOKEN,USE_CACHE main.ts
Or set
DEBUG=grammy*
to see the debug logs.Required permissions
net
- To communicate with Telegram servers and receive updates.env
- To access environment variables.
When using the cache include:
read
- To read cached files.write
- To write cache files.
The working bot, @scripturbot is currently
deployed on Deno Deploy. Even though I have
implemented a fine getbible.net API call caching system, it's not being used
since Deno Deploy currently does not provide file system writing access. If
you're deploying to Heroku or some other, you should be able to enable caching
by providing a USE_CACHE=1
in environment variables.
After deploying you will get a link to your application, in the format
https://<appname>.deno.dev/
.
Open browser and go to the link down below.
- Replace the
<BOT_TOKEN>
with yourBOT_TOKEN
. - Replace
<APP_URL>
with the link to your application.
https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=<APP_URL>
This will set the bot's webhook to the deployed application, so it will be able to handle updates.
Variable | Required? | Description |
---|---|---|
DEBUG |
No. | If not set, the bot would run in the webhook mode. Set to enable long polling. |
BOT_TOKEN |
Yes. | The API token of the Bot. Chat with https://t.me/BotFather to get one. |
USE_CACHE |
No. | Set the value to 1 if you want caching to work. |
This application is licensed under the MIT License. See the LICENSE file for more information on copying and distributing this piece of software.
Contributions are very welcomed here! Want to suggest a feature or report an issue? Feel free to open issues and pull requests if you're working on it.
In loving memory of my friend Shamil.
Made with just <3