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

Link Telegram Database #15

Merged
merged 17 commits into from
Aug 23, 2023
Merged

Conversation

seprintour
Copy link
Collaborator

@seprintour seprintour commented Aug 17, 2023

Resolves #3

  • Last PR included
  • Fixed errors from initial TypeScript conversion
  • Ran multiple tests to get it running

@seprintour
Copy link
Collaborator Author

@pavlovcik check this

Copy link
Member

@0x4007 0x4007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good let's finish QA expediently! @web4er is trying on the telegram side!

src/helpers/navigation.ts Outdated Show resolved Hide resolved
src/helpers/telegram.ts Outdated Show resolved Hide resolved
src/helpers/telegram.ts Outdated Show resolved Hide resolved
@0x4007 0x4007 requested review from web4er and Draeieg August 18, 2023 21:28
Copy link
Contributor

@web4er web4er left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The issue says:

We must be able to associate which Telegram channel/topic goes to which GitHub repository.

It is working with group and topic, but doesn't work with channel.

environment.example.json Outdated Show resolved Hide resolved
src/helpers/prompt.ts Outdated Show resolved Hide resolved
src/helpers/telegram.ts Outdated Show resolved Hide resolved
src/worker.ts Show resolved Hide resolved
@seprintour
Copy link
Collaborator Author

Channel support added @web4er, Reinstall bot with post and edit message permission

Copy link
Contributor

@web4er web4er left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think supabase/config.toml file is not needed here.

Edit: This file is needed for local run, so keep it.

supabase/README.md Show resolved Hide resolved
supabase/README.md Show resolved Hide resolved
supabase/README.md Outdated Show resolved Hide resolved
src/types/globals.ts Outdated Show resolved Hide resolved
@web4er
Copy link
Contributor

web4er commented Aug 21, 2023

Code looks good, but bot is not working after some recent changes.

image

@seprintour
Copy link
Collaborator Author

Code looks good, but bot is not working after some recent changes.

make sure variables are changed to the new names on cloudflare as well and filled accordingly

@seprintour seprintour mentioned this pull request Aug 21, 2023
@web4er
Copy link
Contributor

web4er commented Aug 22, 2023

make sure variables are changed to the new names on cloudflare as well and filled accordingly

I deleted the old deployment and deployed the fresh changes. Here are the variables on Cloudflare.

image

@seprintour
Copy link
Collaborator Author

I deleted the old deployment and deployed the fresh changes. Here are the variables on Cloudflare.

github_installation_token

@seprintour
Copy link
Collaborator Author

GITHUB_INSTALLATION_TOKEN not INSTALLATION_TOKEN anymore

@web4er
Copy link
Contributor

web4er commented Aug 22, 2023

GITHUB_INSTALLATION_TOKEN not INSTALLATION_TOKEN anymore

Do I have to add it manually? because I did yarn setup-key already.

@seprintour
Copy link
Collaborator Author

seprintour commented Aug 22, 2023

GITHUB_INSTALLATION_TOKEN not INSTALLATION_TOKEN anymore

Do I have to add it manually? because I did yarn setup-key already.

I think your code is not updated, because the variable names have changed so that should change automatically too.

You can try deleting everything, updating your branch and running setup-key again

@seprintour
Copy link
Collaborator Author

We have to be done with this soon, its been open for too long..

We have #17

@web4er
Copy link
Contributor

web4er commented Aug 22, 2023

I think your code is not updated, because the variable names have changed so that should change automatically too.

Yes, I thought it was missing that in code. Working now.

Copy link
Contributor

@web4er web4er left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, working well in group, topics, and channels.
I believe the following would be the steps to deploy this PR.

  • create supabase db and deploy migrations
  • set up environment.json, update new and old both vars, because names have changed.
  • yarn setup-key
  • yarn deploy
  • add bot to group, and chat with bot using /start to provide github repo link.

@seprintour
Copy link
Collaborator Author

  • yarn setup-key
  • yarn deploy

These are handled automatically by the Github actions, Just some variable names change in secret

Copy link
Member

@0x4007 0x4007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like my earlier requested changes were not implemented please confirm the status and then I can approve and merge.

Perhaps they were on the other pull request that this one is based off of?

messages: [
{
role: "system",
content: TRAINING,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you never renamed this to PROMPT_SYSTEM


export const handleFirstMenu = async (value: string, chatId: number, messageId: number, groupData: string) => {
switch (value) {
case "link_github":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall asking about a /register command but I could be confused here.

const userContext = getUserSession(chatId);

switch (userContext.v) {
case "link_github":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/register here as well.

"*`[]()"
);
const msg = data.html_url
? `*Issue created: [Check it out here](${data.html_url})* with time estimate *${timeEstimate}*${assignees ? ` and @${tagged} as assignee` : ""}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also believe I wrote somewhere an adjusted message without the "check it out here" part but I have to look for that and it's a bit slow from my phone.

@seprintour
Copy link
Collaborator Author

It looks like my earlier requested changes were not implemented please confirm the status and then I can approve and merge.

Perhaps they were on the other pull request that this one is based off of?

These changes were made in #17

@seprintour
Copy link
Collaborator Author

You made the review and it got implemented here: c476f88

@0x4007 0x4007 merged commit a451184 into ubiquity:development Aug 23, 2023
1 check passed
@seprintour
Copy link
Collaborator Author

@pavlovcik can you add SUPABASE_URL and SUPABASE_KEY to .env and rename INSTALLATION_TOKEN to GITHUB_INSTALLATION_TOKEN

@seprintour
Copy link
Collaborator Author

and TOKEN to TELEGRAM_BOT_TOKEN in secrets

@0x4007
Copy link
Member

0x4007 commented Aug 23, 2023

@pavlovcik can you add SUPABASE_URL and SUPABASE_KEY to .env and rename INSTALLATION_TOKEN to GITHUB_INSTALLATION_TOKEN

You should have access to manipulate the secrets in this repository. I assume you can handle everything except for the Telegram bot token (but I just checked, and this is already in our secrets as of two weeks ago.)

@seprintour
Copy link
Collaborator Author

You should have access to manipulate the secrets in this repository

I only have access to cloudflare variables

@0x4007
Copy link
Member

0x4007 commented Aug 23, 2023

I updated your permissions to maintain role. Can you see this?
https://github.com/ubiquity/telegram-ubiquibot/settings/secrets/actions

@seprintour
Copy link
Collaborator Author

Can you see this?

No, its a 404 page

@0x4007
Copy link
Member

0x4007 commented Aug 23, 2023

I sent you dm on telegram

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegram Database
3 participants