Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Send Telegram Message Functionality #2593

Closed
wants to merge 9 commits into from
Closed

Added Send Telegram Message Functionality #2593

wants to merge 9 commits into from

Conversation

Reno-Codes
Copy link

@Reno-Codes Reno-Codes commented Apr 19, 2023

Background

While waiting for AutoGPT to do tasks, It's useful to receive a notification message on Telegram when some task is done.
I know it's a potential plugin, but many people will find it essential to receive notifications on Telegram about their AutoGPT status.

Changes

Added telegram.py in the commands folder.
Added entries for it in app.py and prompt.py.

Documentation

Create a bot on telegram by contacting @Botfather.
Give your Telegram bot a name, like "AutoGPT Notifier" or whatever.
Copy bot token from telegram and paste it into TELEGRAM_BOT_TOKEN in your .env file.

While setting up a GOAL for AutoGPT, just write something like "Send telegram message when done with previous tasks." or whatever you'd like to receive as a notification from your AI.

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@k-boikov k-boikov added the potential plugin This may fit better into our plugin system. label Apr 19, 2023
@k-boikov
Copy link
Contributor

I very well see that PR transforming into a Plugin, since we are getting a bunch of them, please check on #757 it is expected to be
ready for the end of the week

@Reno-Codes
Copy link
Author

I very well see that PR transforming into a Plugin, since we are getting a bunch of them, please check on #757 it is expected to be ready for the end of the week

Yeah, it's more suitable as a plugin. I'll convert it when plugin.py is released :)

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 20, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@Pwuts
Copy link
Member

Pwuts commented Apr 20, 2023

@Reno-Codes plugin support will ship very soon, it was just merged to master. I'm closing this PR and hoping to see it return as a plugin :)

@Pwuts Pwuts closed this Apr 20, 2023
@Wladastic
Copy link
Contributor

please check this PR first:
#1135

@Reno-Codes
Copy link
Author

please check this PR first: #1135

@Wladastic Your Telegram bot requires too much effort for an average user. The average user wouldn't be able to curl https://api.telegram.org/bot<your-telegram-bot-token>/getUpdates and from JSON response find their chatID.

Why not just paste the bot token and AutoGPT should handle getting chatID automatically.

@Wladastic
Copy link
Contributor

the average user just has to visit https://api.telegram.org/bot/getUpdates with their browser.
But i am already planning a setup script for that

@Wladastic
Copy link
Contributor

Also the gathering method is very insecure, please also keep in mind that your bot receives messages by everyone.

@Reno-Codes
Copy link
Author

the average user just has to visit https://api.telegram.org/bot/getUpdates with their browser. But i am already planning a setup script for that

Yeah, that would work, AutoGPT handling this by itself...

I know the gathering method is insecure, I made it that way for bots that are only made for purpose of notifying users who made that bot specifically for this purpose, and not for bots that receive messages from other users too.

Your approach seems pretty solid, looking forward to seeing it as a plugin since I'm using it in pretty much every AutoGPT goal.

@Wladastic
Copy link
Contributor

As a headsup, this will work soon as a plugin.
One PR merged soon and we have to wait a few hours for the owner to update the python dependency of the plugin template :)

Context: otherwise there are a few methods missing on the class the object of the plugin is casted to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts potential plugin This may fit better into our plugin system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants