Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
chore: edit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
seprintour committed Aug 18, 2023
1 parent 3f90a61 commit 0bdf9a5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ yarn

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

```json
{
"token": "", // Telegram Bot Token, use @BotFather to create a bot an input the token here
"webhook": "/endpoint", // Path for telegram cloudflare communication (default preffered)

This comment has been minimized.

Copy link
@0x4007

0x4007 Sep 21, 2023

Member

Can you elaborate on this @seprintour ?

This comment has been minimized.

Copy link
@seprintour

seprintour Sep 21, 2023

Author Collaborator

The webhook endpoint or the token? @pavlovcik

This comment has been minimized.

Copy link
@0x4007

0x4007 Sep 21, 2023

Member

The endpoint.

This comment has been minimized.

Copy link
@seprintour

seprintour Sep 21, 2023

Author Collaborator

Just a path for the bot communication, so it bot knows what url path its listening to for task management.

Its passed to the telegram bot when registering so the bot instance and the telegram bot can communicate with that endpoint and check if the secret is correct as well

"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)",
"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](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)

[@BotFather for telegram bots](https://t.me/botfather)

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

If you are using yarn:
Expand Down Expand Up @@ -50,3 +70,17 @@ 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](https://t.me/botfather) dashboard (On Telegram) - Add slash commands `/start`
3. 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](https://github.com/ubiquity/telegram-ubiquibot/assets/51956013/4e3d9313-af18-406e-9c91-3efcc372eb54)

4. Members of your group can use `/github_link` 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](https://www.teleme.io/articles/group_privacy_mode_of_telegram_bots?hl=en)
2. Every other errors can be debugged from the Cloudflare Worker dashboard (under Real-time Logs)

0 comments on commit 0bdf9a5

Please sign in to comment.