telegram

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2024 License: ISC Imports: 10 Imported by: 0

Documentation

Overview

Package telegram contains a Starlark module that exposes the Telegram Bot API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(token string, client *http.Client) *starlarkstruct.Module

Module returns a Starlark module that exposes the Telegram Bot API.

This module provides a single function, call, which makes requests to the Telegram Bot API.

The call function takes two arguments:

  • method (string): The Telegram Bot API method to call.
  • args (dict): The arguments to pass to the method.

For example, to send a message to a chat:

result = telegram.call(
    method = "sendMessage",
    args = {
        "chat_id": 123456789,
        "text": "Hello, world!"
    }
)

The result variable will contain the response from the Telegram Bot API.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL