Skip to main content

Use uagents to automate SMS/Whatsapp by twilio

Project description

PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uagents_twilio-1.0.7.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

uagents_twilio-1.0.7-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file uagents_twilio-1.0.7.tar.gz.

File metadata

  • Download URL: uagents_twilio-1.0.7.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.19.0-46-generic

File hashes

Hashes for uagents_twilio-1.0.7.tar.gz
Algorithm Hash digest
SHA256 b97197fa22bd91874a4ba0648670a035b8f452845fbf1bc4e31ffcbab87baf0e
MD5 07293c0586c19b6395b10320cfcfe342
BLAKE2b-256 19eba34104217a88f66f5a1d5cdbb62114a2509a24b14b2556469495e476dfa3

See more details on using hashes here.

File details

Details for the file uagents_twilio-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: uagents_twilio-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.19.0-46-generic

File hashes

Hashes for uagents_twilio-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 964d6763783b16f7c6099f03ff93a46a6892c836ca0d34454a77b30c3a5c126b
MD5 b913225e0bc4678e7771ed7954708828
BLAKE2b-256 d5958662a13334e635a42696af4a8a0f1fbb48a311ead18ddfd9842263ed5b3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page