Giter Site home page Giter Site logo

alwaysbegrowing / telegram-standup-bot Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 10.0 1.42 MB

Very simple telegram bot for submitting daily standups

Home Page: https://stoodbot.vercel.app

License: MIT License

JavaScript 5.04% CSS 2.62% TypeScript 87.19% Shell 5.16%
telegram-standup-bot standups bot telegram reminders telegram-polly telegram-standuply daily daily-report telegram-bot

telegram-standup-bot's Introduction

πŸ€– Stood Bot

A Telegram bot that helps you stay on track with daily updates! All members of a chat can participate and stay in the loop.

πŸ’‘ How to use

  1. Add @stood_bot to the chats you want to receive updates in.
  2. Type /subscribe in each of those chats to start receiving updates.

πŸ—“οΈ Schedule

  • Reminders to submit updates sent at 10AM EST.
  • Updates posted at 11AM EST.

πŸ”§ Support

If you're having trouble with the bot, feel free to create a GitHub issue.

πŸ› οΈ Self-Hosting Setup

  1. Install Vercel CLI: yarn global add vercel
  2. Set up the project with Vercel: vercel deploy (accept all default settings)
  3. Create a Telegram bot with BotFather: https://core.telegram.org/bots#6-botfather
  4. Add your Telegram bot API key as an environment variable: vercel env add TELEGRAM_API_KEY
  5. Create a database instance with MongoDB Atlas (name your database "standup"): https://www.mongodb.com/cloud/atlas
  6. Add your MongoDB URI as an environment variable: vercel env add MONGODB_FULL_URI
  7. Pull down the environment variables as a local .env file for local development: vercel env pull
  8. Set up a webhook to your Vercel standup URL: https://api.telegram.org/bot${TELEGRAM_API_KEY}/setWebhook?url=https://.../api/standup?key=${TELEGRAM_API_KEY}

πŸ’» Local Development

yarn
vercel dev

This runs the website at localhost:3000 and runs your Lambda functions in the /api folder on localhost:3000/api. For more information, check out Vercel's Serverless Functions Introduction.

πŸ”Ž Troubleshooting

If your messages or commands aren't going through, check for any pending updates and read the error. You may have to fix the error, or it will happen again.

https://api.telegram.org/bot${TELEGRAM_API_KEY}/getWebhookInfo
https://api.telegram.org/bot${TELEGRAM_API_KEY}/deleteWebhook?drop_pending_updates=true

To view your function logs in Vercel, log in to Vercel, navigate to your bot, click on your functions, and then view the function logs.

telegram-standup-bot's People

Contributors

geczy avatar mgatespot avatar namaskar-1f64f avatar russeii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

telegram-standup-bot's Issues

still notifies you on update send

i thought doing disable_notification would resolve this but it hasn't, my phone still gets a notification for every group i'm in

maybe remove the @mention entirely and just keep first name? the con is that it would be hard to find peoples responses i think

Undefined Name in Winner Message

Describe the bug
The winner message outputs a very unfriendly message seen below 😒

To Reproduce
Steps to reproduce the behavior:

  1. Make an account without a username set
  2. Create a new channel that only you are in
  3. Subscribe to stoodbot events
  4. Be "randomly" chosen
  5. View error

Expected behavior
The bot should address the person's first & last name if there is not a username given

Screenshots
image

UI piece is AWESOME let's make it even better

Thoughts I had:

  • Show most recent unlocked update by default without having to expand the accordion
  • #49
  • What happens after 30 days of updates? The accordions will be miles long
  • #47

Other notes:

  • There are back-ticks around all of the messages

image

Allow multiple messages for a single update

Right now, I submit a piece of text and then submit a photo. The photo is all that sends. I would like for the update to accept all messages up to some reasonable max.

Upon first message say:
Awesome, thanks for the update. I will send this out at 11, but before then, feel free to add more to the update by sending me another message, view and edit your update by pressing the buttons below.

There will be a view button that takes the user to their update draft on the web interface.

There will be an edit button that takes the user to the edit interface on the web.

A Start Over? button can be pressed to remove the whole update after a confirmation. The bot will say

A great idea to start over, some of the best ideas come from writing down thoughts multiple times.

Upon sending another message, the bot respond with:

Great. Got your additions! View or edit your updated update below.

reactions trigger update

Describe the bug
Reactions on old messages re-trigger bot as if they were sent by the author.

To Reproduce
Steps to reproduce the behavior:

  1. React to a previous command in the chat
  2. Observe stood bot responding to it.

Expected behavior
Reactions have no effect on stood bot.

Screenshots
image
image

Add TG bot to telegram directories

If we want users it'd probably be worthwhile to submit the bot to several of the popular TG bot aggregators out there. (Sadly TG doesn't have its own!)

Implement Pagination for /view endpoint

/view endpoint currently returns ALL of the past updates. I plan to use this bot for YEARS which means every single day the data returned by /view will increase and increase

Explore CMS solutions

Wordpress?

Plugin to auth with telegram

Plugin to post your blog posts to your telegram groups

All of these exist already and it seems to be the direction we're going

Make lottery less random

A request for a less random picker was brought up after some people out of a group of 15 participants have yet to be picked in the past two months.

Describe the solution you'd like
Have a new list of weights per participant. the weights can start proportionally and when a person is chosen, their weight is cut by 3/4 and their weight is evenly distributed to the other participants. When a new participant joins, weights are adjusted to allow the newcomer a starting proportional weight.

Describe alternatives you've considered
to start - make sure a person isn't chosen twice in a row by filtering out the previous winners.

await unsetWinners();

Additional context
Maybe something like this? https://www.npmjs.com/package/random-weighted-choice where everyone but the winner's weight is increased by 1? and newcomer weight is the average of all weights?

Remove groups that the bot can't access anymore

Describe the bug

The bot will still roll for you in groups it doesn't exist

To Reproduce
Steps to reproduce the behavior:

  1. Add it to a group
  2. Remove it from the group
  3. Still get a lottery message

Users with privacy settings hiding profile photo see no updates

Describe the bug
When viewing the update page as a logged in user, there are no updates shown.

To Reproduce
Steps to reproduce the behavior:

  1. Set Profile Photo in "Privacy and Security" to "My Contacts"
  2. Maybe log out and log back in?
  3. Observe no updates

Expected behavior
Updates are shown

Add /clear command

Is your feature request related to a problem? Please describe.

I'm always frustrated when I have updates queued up, but I can't delete one

Describe the solution you'd like

Delete an update in the chat to prevent it from posting

Describe alternatives you've considered

/clear to delete all pending updates

Additional context

There's no event on deleting a message in a bot DM :( which makes native deletion hard but not impossible (can check if the msg id exists still / is viewable before it sends)

Enable / disable update lottery system

One person a week per group will get picked to post an update for Friday

/enablelottery

/disablelottery

Maybe enable / disable command per the group you're in? That way you can pick which groups should get the lottery and which ones get the daily update, rather than an all or nothing setting

Improve Instructions

Yes but it seems like it would just remind me to post it myself (I only thought otherwise because I saw it post on your behalf)
image

Add info about how to edit message in DM'd help

Is your feature request related to a problem? Please describe.
More info about how stoodbot updates would give users more confidence on how it will work and output.

Describe the solution you'd like
A help command or reminders when someone posts a lot of updates, "remember you can edit your previous messages and I'll send the updated version" or a way to preview and erase the update to start over.

Describe alternatives you've considered
Telling the person myself how it works. That doesn't solve the problem for everyone and makes me do extra work.

Additional context
image

Telegram login button replacement

Don't use telegram api to load the button it's too slow

Or maybe load it sooner in the document

See if you can wrap it with a geist button

Fine tune control over reminders

itd be cool to control the reminders it sends. i think ideally i want to be reminded to send an update at random intervals throughout the week. maybe a simple algorithm where each day there is a 14% chance i get a reminder. that way, ill get a reminder on average once a week.

Perhaps a week picker with time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.