Skip to content

Your AI powered repository manager (on Telegram.)

Notifications You must be signed in to change notification settings

Steveantor/telegram-ubiquibot

 
 

Repository files navigation

Telegram UbiquiBot

This project allows you to deploy a TelegramXChatGPT auto bounty issue creator using Cloudflare Workers and wrangler.

Getting Started

  1. Fork/clone the repository:

  2. Install dependencies:

If you are using yarn:

cd telegram-ubiquibot
yarn
  1. Environment Setup:
  • Copy the environment.example.json file and rename it to environment.json.

  • Fill in the required data in the environment.json file.

  • After filling in the data, run the setup key command:

If you are using yarn:

yarn setup-key

This command will set up the necessary secrets for your Cloudflare Workers application and await until the setup is complete.

  1. Changing Keys:

If you need to change any key, you can use the following command:

wrangler secret delete <KEY>

Replace <KEY> with the name of the secret key you want to change. After deleting the key, you can run the setup key command again to set the new key.

  1. Deploying the App:

To deploy the application, simply run:

yarn deploy

This command will deploy your Cloudflare Workers application and make it accessible.

Telegram UbiquiBot

This project allows you to deploy a TelegramXChatGPT auto bounty issue creator using Cloudflare Workers and wrangler.

Getting Started

  1. Fork/clone the repository:

  2. Install dependencies:

If you are using yarn:

cd telegram-ubiquibot
yarn
  1. Environment Setup:
  • Copy the environment.example.json file and rename it to environment.json.

  • Fill in the required data in the environment.json file.

{
  "telegram_bot_token": "", // Telegram Bot Token, use @BotFather to create a bot an input the token here
  "webhook": "/endpoint", // Path for telegram cloudflare communication (default preffered)
  "secret": "QUEVEDO_BZRP_Random_String_52", // Random string for secure communication
  "openai_api_key": "", // OpenAI ChatGPT API Key (Valid)
  "github_pat": "", // Github Personal Access Token (Empty if you are using a bot)
  "default_priority": "Priority: 0 (Normal)",
  "github_installation_token": "", // Automatically generated by Github Action if you are using a bot
  "client_id": "", // Github OAuth App Client ID
  "client_secret": "", // Github OAuth App Client Secret
  "supabase_key": "", // Supabase Service Role Key
  "supabase_url": "" // Supabase Project URL
}

Here's a guide to create Github App

Note: Your Github App Callback URL should be https://YOUR_CLOUDFLARE_WORKER_URL/endpoint or / whatever you used in place of "webhook": "/endpoint"

@BotFather for telegram bots

  • After filling in the data, run the setup key command:

If you are using yarn:

yarn setup-key

This command will set up the necessary secrets for your Cloudflare Workers application and await until the setup is complete.

  1. Changing Keys:

If you need to change any key, you can use the following command:

wrangler secret delete <KEY>

Replace <KEY> with the name of the secret key you want to change. After deleting the key, you can run the setup key command again to set the new key.

  1. Deploying the App:

To deploy the application, simply run:

yarn deploy

This command will deploy your Cloudflare Workers application and make it accessible.

Testing Telegram Bot

  1. Install Bot on your group
  2. Edit Bot in @BotFather dashboard (On Telegram) - Add slash commands /start
  3. Copy your Worker URL on Github and add /registerWebhook as suffix, ex: https://WORKER_URL/registerWebhook - it should return Ok if everything works then you can move to the next step
  4. Use the private chat as an admin to trigger the /start command and link a Github Repo to any of the listed channels

Screenshot 2023-08-18 at 8 15 28 PM

  1. Members of your group can use /register command (sent to the group) and a link will be sent to their inbox to bind their telegram with their Github accounts

Troubleshooting Telegram

  1. Bot cannot read messages - Solution
  2. Every other errors can be debugged from the Cloudflare Worker dashboard (under Real-time Logs)

About

Your AI powered repository manager (on Telegram.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • Other 0.5%