https://github.com/roziscoding/carbon-telegram-bot
Telegram Chatbot that generates carbon.now.sh images from source code
https://github.com/roziscoding/carbon-telegram-bot
hacktoberfest
Last synced: about 1 year ago
JSON representation
Telegram Chatbot that generates carbon.now.sh images from source code
- Host: GitHub
- URL: https://github.com/roziscoding/carbon-telegram-bot
- Owner: roziscoding
- License: gpl-3.0
- Archived: true
- Created: 2019-08-25T14:49:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:12:37.000Z (about 3 years ago)
- Last Synced: 2024-09-12T04:13:08.344Z (over 1 year ago)
- Topics: hacktoberfest
- Language: TypeScript
- Homepage:
- Size: 748 KB
- Stars: 65
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
carbon.now.sh telegram chatbot
========
> This project uses code from [carbon-now-cli](https://github.com/mixn/carbon-now-cli). Go give it a star!
> Also, give [carbon.now.sh](https://github.com/carbon-app/carbon) a star for their awesome work
# Usage
Just hit it [on Telegram](https://t.me/carbonshbot). It'll tell you what to do
# What is it
Telegram chatbot created to generate nice code images using puppeteer on carbon.now.sh.
Everytime it gets a block of pre-formatted code (surrounded by three backticks), it generates an image with on [carbon.now.sh](https://carbon.now.sh), an uses puppeteer to grab a screenshot of that page.
If you want, you can change the default theme and settings for your images by sending the `/settings` command on a private chat with the bot. This settings apply to you regardless of the chat (groups or private) you are in.
# How to run it
The first thing you'll need is an authorization token to communicate with Telegram's bot API. You can get it from [BotFather](https://t.me/botfather).
Then, choose one of the methods below and follow the instructions.
## Locally
- Clone this repo and cd into it
- Run `npm install`
- Run `npm run build`
- Set all environment variables described in the [sample envs file](.envrc.sample)
- Run `npm start`
## Using Docker
- Clone this repo and cd into it
- Run `docker build . -t IMAGE_TAG` replacing IMAGE_TAG with the desired local tag for this image
- - Set all environment variables described in the [sample envs file](.envrc.sample)
- Run `docker run` command mapping the environment variables
## On Heroku
Just click the button below, set the envs and that's it.
[](https://heroku.com/deploy)
# Contributing
See [this](CONTRIBUTING.md)