Use uagents to automate SMS/Whatsapp by twilio
Project description
This uagents utlity was generated with Cookiecutter.
Features
uagents protocols to send SMS or Whatsapp messages using twilio
supports on_message and on_query methods to receive and send messages
Installation
You can install “uagents-twilio” via pip from PyPI:
$ pip install uagents-twilio
You can install “uagents_twilio” via poetry:
$ poetry add uagents-twilio
Usage
Create .env file in root folder of project:
AGENT_ADDRESS="" ACCOUNT_SID="" AUTH_TOKEN="" FROM_NUMBER="" WP_FROM_NUMBER="" TO_NUMBER=""
Create a uagents in your project
Import uagents_twilio protocol:
$ from uagents_twilio.protocols.messages import service_protocol
Include protocol in uagent:
$ service_agent.include(service_protocol)
Use functions:
from uagents_twilio.models import Message, MessageType @service_agent.on_interval(period=2.0) async def send_message(ctx: Context): await ctx.send( AGENT_ADDRESS, Message(receiver="<replace_your_number>", msg="hello there bob", type=MessageType.sms), )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uagents_twilio_test_dummy-1.0.7.tar.gz
.
File metadata
- Download URL: uagents_twilio_test_dummy-1.0.7.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d97c4c439c852b7c66905bcaa42a691f32b44260274053d76834d6cf208bc3 |
|
MD5 | ddaa830ccdc217ae56d314ce95ef4794 |
|
BLAKE2b-256 | 3ad00ea9cb8799bb551b610a3bb550c69fe6a7fc9738ff469fbca5ff15b1ca79 |
File details
Details for the file uagents_twilio_test_dummy-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: uagents_twilio_test_dummy-1.0.7-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8346f1fccd8fd38eb634a56fcea2ff9ef90666412c3ea57e987d4d04b8c328a9 |
|
MD5 | 772573e81825d149d8ebc1520c0e2223 |
|
BLAKE2b-256 | 5fa537a290c60546b64c6626251c9d41f03eb0ed27e3468d122a4837d212432e |