teelebot


Nameteelebot JSON
Version 2.5.0 PyPI version JSON
download
home_pagehttps://ojoll.com
Summaryteelebot is a Python-based Telegram Bot framework with a plugin system that supports hot reload and hot loading.
upload_time2024-03-04 06:06:46
maintainer
docs_urlNone
authorPluto
requires_python>=3.6
licenseGPLv3
keywords teelebot telegram bot telegram bot api telegram
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
  <br>
  <a href="#" alt="logo" ><img src="./LOGO.png" width="150"/></a>
  <br>
  teelebot
  <br>
</h1>
<h4 align="center">Python实现的Telegram Bot机器人框架,具有插件系统,插件支持热更新和热装载。</h4>

```bash
    __            __     __          __
   / /____  ___  / /__  / /_  ____  / /_
  / __/ _ \/ _ \/ / _ \/ __ \/ __ \/ __/
 / /_/  __/  __/ /  __/ /_/ / /_/ / /_
 \__/\___/\___/_/\___/_.___/\____/\__/

```





## 说明

**teelebot** 是Python编写的Telegram Bot框架。**teelebot** 具有**插件系统**,Bot功能以插件的形式组织,你只需要实现具有特定功能的插件,其余细节交给 **teelebot** 框架处理,极大地提高了Bot的开发部署效率。**你可以自由地组合插件,来搭建具有特定功能的Bot**。



**插件请前往:[官方插件仓库](https://github.com/plutobell/teelebot-plugins)**

**推荐插件:**

* **Menu** - 自动生成的插件菜单

* **Uptime** - 获取Bot运行状态

* **PluginCTL** - 插件分群开关控制

* **PluginManagementTools** - 插件包管理工具

* **Guard** - 广告过滤, 使用 DFA 对消息进行过滤;入群验证码人机检测

  





## 更新日志

* **[更新日志](./CHANGELOG.md)**



## 方法列表

* **[方法列表](./FUNCTION.md)**



## 插件开发指南

* **[插件开发指南](./PLUGINGUIDE.md)**



## Demo

* **Telegram Group:[teelebot official](https://t.me/teelebot_official)(t.me/teelebot_official)**
* **Bot : [teelebotBot](https://t.me/teelebotBot)(t.me/teelebotBot)**
* ~~Telegram Group: [teelebot体验群](http://t.me/teelebot_chat)(t.me/teelebot_chat)~~
* ~~Bot : [teelebot](http://t.me/teelebot)(t.me/teelebot)~~







## 环境要求

### Python版本

teelebot 只支持 Python3.x,不支持Python2.x。

本项目在 Python 3.6 及以上版本测试通过。





## 安装

**1.Pip**

```bash
pip install teelebot
```

**此方式推荐使用Python虚拟环境安装**



**2.Docker**

```bash
# 无代理
docker run -it \
	--name teelebot \
	--restart always \
	-v /path/to/teelebot/config:/config \
	-v /path/to/teelebot/plugins:/plugins \
	ghcr.io/plutobell/teelebot:latest
	
# 有代理
docker run -it \
	--name teelebot \
	--restart always \
	--network host \
	-e http_proxy="http://ip:port" \
	-e https_proxy="http://ip:port" \
	-v /path/to/teelebot/config:/config \
	-v /path/to/teelebot/plugins:/plugins \
	ghcr.io/plutobell/teelebot:latest
```

**Tip: 容器创建后请完善配置文件参数,然后重启容器**







## 升级

**1.Pip**

```
pip install teelebot --upgrade
```

**2.Docker**

```bash
# 与Docker容器升级方法相同
```

另外,可通过 `exec` 指令在容器中执行命令 `pip install teelebot --upgrade` 进行升级





## 使用

#### 一行命令启动 (Polling Mode)

请自行替换 `< ... >` 的内容

```
teelebot -c/--config <config file path> -p/--plugin <plugin path> -k/--key <bot key> -r/--root <your user id>
```

**此命令会自动生成在Polling模式下适用的配置文件,并且,-c/--config 参数可以省略(省略将使用默认配置文件路径)。**



#### 一、运行模式

`teelebot` 支持以 `Webhook` 模式和 `Polling` 模式运行。生产环境推荐使用 `Webhook` 模式,而 `Polling` 则仅用于开发环境。



##### 1、Webhook 模式

要以 `Webhook` 模式运行,请将配置文件字段 `webhook` 设置为 `True` ,此模式涉及的配置文件字段如下:

```python
[config]
webhook=True
self_signed=False
cert_key=your private cert path
cert_pub=your public cert path
load_cert=False
server_address=your server ip address or domain
server_port=your server port
local_address=webhook local address
local_port=webhook local port
secret_token=webhook secret token
```

`self_signed` 用于设置是否使用自签名证书,而 `cert_key` 和 `cert_pub` 是你的证书路径(绝对路径),`load_cert` 则用于设置 Webhook 是否加载本地证书; `server_address` 为你的服务器公网IP, `server_port` 为服务器的端口(目前 telegram 官方仅支持 443,  80,  88,  8443),`local_address` 为Webhook 本地监听地址, `local_port` 为 Webhook 本地运行的端口;`secret_token` 则用于设置 Webhook 的secret token。

自签名证书生成请参考:[Generating a self-signed certificate pair (PEM)](https://core.telegram.org/bots/self-signed#generating-a-self-signed-certificate-pair-pem)



##### 2、Polling 模式

要以 Polling 模式运行,只需要保证配置文件 `webhook` 字段为 `False` 即可。此模式最基本的配置文件如下:

```
[config]
key=bot key
root_id=your user id
pool_size=40
webhook=False
debug=False
plugin_dir=your plugin dir
```







#### 二、运行

任意路径打开终端,输入以下命令:

- 对于使用程序配置文件默认路径的:

  输入`teelebot` 回车,正常情况下你应该能看见屏幕提示机器人开始运行。

- 对于命令行手动指定配置文件路径的:

  输入`teelebot -c/--config <configure file path>` 回车,正常情况下你应该能看见屏幕提示机器人开始运行。
  
  **更多指令请通过 `-h/--help` 查看:**
  
  ```bash
  usage: -m [-h] [-c CONFIG] [-k KEY] [-r ROOT] [-p PLUGIN] [-mp MAKE_PLUGIN]
            [-L] [-C] [-hi] [-d] [-v]
  
  teelebot console command list
  
  options:
    -h, --help            show this help message and exit
    -c CONFIG, --config CONFIG
                          specify the configuration file
    -k KEY, --key KEY     specify the bot api token
    -r ROOT, --root ROOT  specify the telegram user user_id of bot admin
    -p PLUGIN, --plugin PLUGIN
                          specify the plugin path
    -mp MAKE_PLUGIN, --make_plugin MAKE_PLUGIN
                          create a plugin template
    -L, --logout          log out from the cloud Bot API server before running
                          the bot locally
    -C, --close           close the bot instance before transferring it between
                          local servers
    -hi, --hide_info      hide plugin info-level console logs
    -d, --debug           run teelebot in debug mode
    -v, --version         show the current version of teelebot
  ```
  
  







#### 三、配置文件

**完整的配置文件**如下所示:

```python
[config]
key=bot key
root_id=your user id
plugin_dir=your plugin dir
pool_size=40 # the thread pool size, default 40, range(1, 101)
buffer_size=16 # the buffer area size, default 16(MB)
webhook=False
self_signed=False # Optional while webhook is False
cert_key=your private cert path # Optional while webhook is False
cert_pub=your public cert path # Optional while webhook is False
load_cert=False # Optional while webhook is False
server_ip=your server ip address # Optional while webhook is False
server_port=your server port # Optional while webhook is False
local_address=webhook local address # Optional while webhook is False
local_port=webhook local port # Optional while webhook is False
secret_token=webhook secret token
debug=False
hide_info=False
drop_pending_updates=False
local_api_server=local api server address # [Optional]
updates_chat_member=False # [Optional]
proxy=socks5h://user:pass@host:port # [Optional]
```

**在 `1.13.0` 及以上版本,支持自动生成配置文件。(默认为Polling模式)**

1.在命令行未指定配置文件路径的情况下,会在默认配置文件路径下不存在配置文件时自动生成配置文件 `config.cfg`。

* 在Linux下,会自动在用户目录下创建文件夹 `.teelebot` ,并生成配置文件 `config.cfg`

* 在Windows下,则会在 `C:\Users\<username>`  目录下创建文件夹 `.teelebot` ,并生成配置文件 `config.cfg` 

2.指定配置文件

Linux 和 Windows 都可在命令行通过参数手动指定配置文件路径,命令格式:

```
teelebot -c/--config <configure file path>
```

路径必须为绝对路径,并且配置文件名也应当包含在路径内,此情况下会在指定的配置文件不存在时自动生成配置文件 。



#### 四、导入使用

```python
# 导入Bot类
from teelebot import Bot

# 实例化Bot类
# 不传参数时会使用teelebot默认配置文件路径下的配置文件实例化Bot类
# 在v2.2.0及以上版本,可传递参数覆盖配置文件的设定,可覆盖的参数:
#     Bot(key: str = None, debug: bool = False, proxies: dict = None)
bot = Bot()

# 使用Bot类
bot.sendMessage(chat_id="chat_id", text="Hello World!")
```

**Tip: 导入使用时需要确保默认配置文件路径中存在配置文件,并且必须的字段已经填写**





## 联系我

* Email:hi#ojoll.com ( # == @ )
* Blog:    [北及](https://ojoll.com)
* Telegram Group:[teelebot official](https://t.me/teelebot_official)(t.me/teelebot_official)
* ~~Telegram Group:[teelebot体验群](http://t.me/teelebot_chat)(t.me/teelebot_chat)~~
* 其他:本repo 的 Issue








            

Raw data

            {
    "_id": null,
    "home_page": "https://ojoll.com",
    "name": "teelebot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "teelebot telegram bot telegram bot api telegram",
    "author": "Pluto",
    "author_email": "hi@ojoll.com",
    "download_url": "",
    "platform": null,
    "description": "<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"#\" alt=\"logo\" ><img src=\"./LOGO.png\" width=\"150\"/></a>\r\n  <br>\r\n  teelebot\r\n  <br>\r\n</h1>\r\n<h4 align=\"center\">Python\u5b9e\u73b0\u7684Telegram Bot\u673a\u5668\u4eba\u6846\u67b6\uff0c\u5177\u6709\u63d2\u4ef6\u7cfb\u7edf\uff0c\u63d2\u4ef6\u652f\u6301\u70ed\u66f4\u65b0\u548c\u70ed\u88c5\u8f7d\u3002</h4>\r\n\r\n```bash\r\n    __            __     __          __\r\n   / /____  ___  / /__  / /_  ____  / /_\r\n  / __/ _ \\/ _ \\/ / _ \\/ __ \\/ __ \\/ __/\r\n / /_/  __/  __/ /  __/ /_/ / /_/ / /_\r\n \\__/\\___/\\___/_/\\___/_.___/\\____/\\__/\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n## \u8bf4\u660e\r\n\r\n**teelebot** \u662fPython\u7f16\u5199\u7684Telegram Bot\u6846\u67b6\u3002**teelebot** \u5177\u6709**\u63d2\u4ef6\u7cfb\u7edf**\uff0cBot\u529f\u80fd\u4ee5\u63d2\u4ef6\u7684\u5f62\u5f0f\u7ec4\u7ec7\uff0c\u4f60\u53ea\u9700\u8981\u5b9e\u73b0\u5177\u6709\u7279\u5b9a\u529f\u80fd\u7684\u63d2\u4ef6\uff0c\u5176\u4f59\u7ec6\u8282\u4ea4\u7ed9 **teelebot** \u6846\u67b6\u5904\u7406\uff0c\u6781\u5927\u5730\u63d0\u9ad8\u4e86Bot\u7684\u5f00\u53d1\u90e8\u7f72\u6548\u7387\u3002**\u4f60\u53ef\u4ee5\u81ea\u7531\u5730\u7ec4\u5408\u63d2\u4ef6\uff0c\u6765\u642d\u5efa\u5177\u6709\u7279\u5b9a\u529f\u80fd\u7684Bot**\u3002\r\n\r\n\r\n\r\n**\u63d2\u4ef6\u8bf7\u524d\u5f80\uff1a[\u5b98\u65b9\u63d2\u4ef6\u4ed3\u5e93](https://github.com/plutobell/teelebot-plugins)**\r\n\r\n**\u63a8\u8350\u63d2\u4ef6\uff1a**\r\n\r\n* **Menu** - \u81ea\u52a8\u751f\u6210\u7684\u63d2\u4ef6\u83dc\u5355\r\n\r\n* **Uptime** - \u83b7\u53d6Bot\u8fd0\u884c\u72b6\u6001\r\n\r\n* **PluginCTL** - \u63d2\u4ef6\u5206\u7fa4\u5f00\u5173\u63a7\u5236\r\n\r\n* **PluginManagementTools** - \u63d2\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\r\n\r\n* **Guard** - \u5e7f\u544a\u8fc7\u6ee4\uff0c \u4f7f\u7528 DFA \u5bf9\u6d88\u606f\u8fdb\u884c\u8fc7\u6ee4\uff1b\u5165\u7fa4\u9a8c\u8bc1\u7801\u4eba\u673a\u68c0\u6d4b\r\n\r\n  \r\n\r\n\r\n\r\n\r\n\r\n## \u66f4\u65b0\u65e5\u5fd7\r\n\r\n* **[\u66f4\u65b0\u65e5\u5fd7](./CHANGELOG.md)**\r\n\r\n\r\n\r\n## \u65b9\u6cd5\u5217\u8868\r\n\r\n* **[\u65b9\u6cd5\u5217\u8868](./FUNCTION.md)**\r\n\r\n\r\n\r\n## \u63d2\u4ef6\u5f00\u53d1\u6307\u5357\r\n\r\n* **[\u63d2\u4ef6\u5f00\u53d1\u6307\u5357](./PLUGINGUIDE.md)**\r\n\r\n\r\n\r\n## Demo\r\n\r\n* **Telegram Group\uff1a[teelebot official](https://t.me/teelebot_official)\uff08t.me/teelebot_official\uff09**\r\n* **Bot : [teelebotBot](https://t.me/teelebotBot)\uff08t.me/teelebotBot\uff09**\r\n* ~~Telegram Group\uff1a [teelebot\u4f53\u9a8c\u7fa4](http://t.me/teelebot_chat)\uff08t.me/teelebot_chat\uff09~~\r\n* ~~Bot : [teelebot](http://t.me/teelebot)\uff08t.me/teelebot\uff09~~\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n## \u73af\u5883\u8981\u6c42\r\n\r\n### Python\u7248\u672c\r\n\r\nteelebot \u53ea\u652f\u6301 Python3.x\uff0c\u4e0d\u652f\u6301Python2.x\u3002\r\n\r\n\u672c\u9879\u76ee\u5728 Python 3.6 \u53ca\u4ee5\u4e0a\u7248\u672c\u6d4b\u8bd5\u901a\u8fc7\u3002\r\n\r\n\r\n\r\n\r\n\r\n## \u5b89\u88c5\r\n\r\n**1.Pip**\r\n\r\n```bash\r\npip install teelebot\r\n```\r\n\r\n**\u6b64\u65b9\u5f0f\u63a8\u8350\u4f7f\u7528Python\u865a\u62df\u73af\u5883\u5b89\u88c5**\r\n\r\n\r\n\r\n**2.Docker**\r\n\r\n```bash\r\n# \u65e0\u4ee3\u7406\r\ndocker run -it \\\r\n\t--name teelebot \\\r\n\t--restart always \\\r\n\t-v /path/to/teelebot/config:/config \\\r\n\t-v /path/to/teelebot/plugins:/plugins \\\r\n\tghcr.io/plutobell/teelebot:latest\r\n\t\r\n# \u6709\u4ee3\u7406\r\ndocker run -it \\\r\n\t--name teelebot \\\r\n\t--restart always \\\r\n\t--network host \\\r\n\t-e http_proxy=\"http://ip:port\" \\\r\n\t-e https_proxy=\"http://ip:port\" \\\r\n\t-v /path/to/teelebot/config:/config \\\r\n\t-v /path/to/teelebot/plugins:/plugins \\\r\n\tghcr.io/plutobell/teelebot:latest\r\n```\r\n\r\n**Tip: \u5bb9\u5668\u521b\u5efa\u540e\u8bf7\u5b8c\u5584\u914d\u7f6e\u6587\u4ef6\u53c2\u6570\uff0c\u7136\u540e\u91cd\u542f\u5bb9\u5668**\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n## \u5347\u7ea7\r\n\r\n**1.Pip**\r\n\r\n```\r\npip install teelebot --upgrade\r\n```\r\n\r\n**2.Docker**\r\n\r\n```bash\r\n# \u4e0eDocker\u5bb9\u5668\u5347\u7ea7\u65b9\u6cd5\u76f8\u540c\r\n```\r\n\r\n\u53e6\u5916\uff0c\u53ef\u901a\u8fc7 `exec` \u6307\u4ee4\u5728\u5bb9\u5668\u4e2d\u6267\u884c\u547d\u4ee4 `pip install teelebot --upgrade` \u8fdb\u884c\u5347\u7ea7\r\n\r\n\r\n\r\n\r\n\r\n## \u4f7f\u7528\r\n\r\n#### \u4e00\u884c\u547d\u4ee4\u542f\u52a8 (Polling Mode)\r\n\r\n\u8bf7\u81ea\u884c\u66ff\u6362 `< ... >` \u7684\u5185\u5bb9\r\n\r\n```\r\nteelebot -c/--config <config file path> -p/--plugin <plugin path> -k/--key <bot key> -r/--root <your user id>\r\n```\r\n\r\n**\u6b64\u547d\u4ee4\u4f1a\u81ea\u52a8\u751f\u6210\u5728Polling\u6a21\u5f0f\u4e0b\u9002\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u4e14\uff0c-c/--config \u53c2\u6570\u53ef\u4ee5\u7701\u7565(\u7701\u7565\u5c06\u4f7f\u7528\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u8def\u5f84)\u3002**\r\n\r\n\r\n\r\n#### \u4e00\u3001\u8fd0\u884c\u6a21\u5f0f\r\n\r\n`teelebot` \u652f\u6301\u4ee5 `Webhook` \u6a21\u5f0f\u548c `Polling` \u6a21\u5f0f\u8fd0\u884c\u3002\u751f\u4ea7\u73af\u5883\u63a8\u8350\u4f7f\u7528 `Webhook` \u6a21\u5f0f\uff0c\u800c `Polling` \u5219\u4ec5\u7528\u4e8e\u5f00\u53d1\u73af\u5883\u3002\r\n\r\n\r\n\r\n##### 1\u3001Webhook \u6a21\u5f0f\r\n\r\n\u8981\u4ee5 `Webhook` \u6a21\u5f0f\u8fd0\u884c\uff0c\u8bf7\u5c06\u914d\u7f6e\u6587\u4ef6\u5b57\u6bb5 `webhook` \u8bbe\u7f6e\u4e3a `True` \uff0c\u6b64\u6a21\u5f0f\u6d89\u53ca\u7684\u914d\u7f6e\u6587\u4ef6\u5b57\u6bb5\u5982\u4e0b\uff1a\r\n\r\n```python\r\n[config]\r\nwebhook=True\r\nself_signed=False\r\ncert_key=your private cert path\r\ncert_pub=your public cert path\r\nload_cert=False\r\nserver_address=your server ip address or domain\r\nserver_port=your server port\r\nlocal_address=webhook local address\r\nlocal_port=webhook local port\r\nsecret_token=webhook secret token\r\n```\r\n\r\n`self_signed` \u7528\u4e8e\u8bbe\u7f6e\u662f\u5426\u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66\uff0c\u800c `cert_key` \u548c `cert_pub` \u662f\u4f60\u7684\u8bc1\u4e66\u8def\u5f84(\u7edd\u5bf9\u8def\u5f84)\uff0c`load_cert` \u5219\u7528\u4e8e\u8bbe\u7f6e Webhook \u662f\u5426\u52a0\u8f7d\u672c\u5730\u8bc1\u4e66\uff1b `server_address` \u4e3a\u4f60\u7684\u670d\u52a1\u5668\u516c\u7f51IP, `server_port` \u4e3a\u670d\u52a1\u5668\u7684\u7aef\u53e3(\u76ee\u524d telegram \u5b98\u65b9\u4ec5\u652f\u6301 443,  80,  88,  8443)\uff0c`local_address` \u4e3aWebhook \u672c\u5730\u76d1\u542c\u5730\u5740\uff0c `local_port` \u4e3a Webhook \u672c\u5730\u8fd0\u884c\u7684\u7aef\u53e3\uff1b`secret_token` \u5219\u7528\u4e8e\u8bbe\u7f6e Webhook \u7684secret token\u3002\r\n\r\n\u81ea\u7b7e\u540d\u8bc1\u4e66\u751f\u6210\u8bf7\u53c2\u8003\uff1a[Generating a self-signed certificate pair (PEM)](https://core.telegram.org/bots/self-signed#generating-a-self-signed-certificate-pair-pem)\r\n\r\n\r\n\r\n##### 2\u3001Polling \u6a21\u5f0f\r\n\r\n\u8981\u4ee5 Polling \u6a21\u5f0f\u8fd0\u884c\uff0c\u53ea\u9700\u8981\u4fdd\u8bc1\u914d\u7f6e\u6587\u4ef6 `webhook` \u5b57\u6bb5\u4e3a `False` \u5373\u53ef\u3002\u6b64\u6a21\u5f0f\u6700\u57fa\u672c\u7684\u914d\u7f6e\u6587\u4ef6\u5982\u4e0b:\r\n\r\n```\r\n[config]\r\nkey=bot key\r\nroot_id=your user id\r\npool_size=40\r\nwebhook=False\r\ndebug=False\r\nplugin_dir=your plugin dir\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n#### \u4e8c\u3001\u8fd0\u884c\r\n\r\n\u4efb\u610f\u8def\u5f84\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a\r\n\r\n- \u5bf9\u4e8e\u4f7f\u7528\u7a0b\u5e8f\u914d\u7f6e\u6587\u4ef6\u9ed8\u8ba4\u8def\u5f84\u7684\uff1a\r\n\r\n  \u8f93\u5165`teelebot` \u56de\u8f66,\u6b63\u5e38\u60c5\u51b5\u4e0b\u4f60\u5e94\u8be5\u80fd\u770b\u89c1\u5c4f\u5e55\u63d0\u793a\u673a\u5668\u4eba\u5f00\u59cb\u8fd0\u884c\u3002\r\n\r\n- \u5bf9\u4e8e\u547d\u4ee4\u884c\u624b\u52a8\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u7684\uff1a\r\n\r\n  \u8f93\u5165`teelebot -c/--config <configure file path>` \u56de\u8f66,\u6b63\u5e38\u60c5\u51b5\u4e0b\u4f60\u5e94\u8be5\u80fd\u770b\u89c1\u5c4f\u5e55\u63d0\u793a\u673a\u5668\u4eba\u5f00\u59cb\u8fd0\u884c\u3002\r\n  \r\n  **\u66f4\u591a\u6307\u4ee4\u8bf7\u901a\u8fc7 `-h/--help` \u67e5\u770b\uff1a**\r\n  \r\n  ```bash\r\n  usage: -m [-h] [-c CONFIG] [-k KEY] [-r ROOT] [-p PLUGIN] [-mp MAKE_PLUGIN]\r\n            [-L] [-C] [-hi] [-d] [-v]\r\n  \r\n  teelebot console command list\r\n  \r\n  options:\r\n    -h, --help            show this help message and exit\r\n    -c CONFIG, --config CONFIG\r\n                          specify the configuration file\r\n    -k KEY, --key KEY     specify the bot api token\r\n    -r ROOT, --root ROOT  specify the telegram user user_id of bot admin\r\n    -p PLUGIN, --plugin PLUGIN\r\n                          specify the plugin path\r\n    -mp MAKE_PLUGIN, --make_plugin MAKE_PLUGIN\r\n                          create a plugin template\r\n    -L, --logout          log out from the cloud Bot API server before running\r\n                          the bot locally\r\n    -C, --close           close the bot instance before transferring it between\r\n                          local servers\r\n    -hi, --hide_info      hide plugin info-level console logs\r\n    -d, --debug           run teelebot in debug mode\r\n    -v, --version         show the current version of teelebot\r\n  ```\r\n  \r\n  \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n#### \u4e09\u3001\u914d\u7f6e\u6587\u4ef6\r\n\r\n**\u5b8c\u6574\u7684\u914d\u7f6e\u6587\u4ef6**\u5982\u4e0b\u6240\u793a:\r\n\r\n```python\r\n[config]\r\nkey=bot key\r\nroot_id=your user id\r\nplugin_dir=your plugin dir\r\npool_size=40 # the thread pool size, default 40, range(1, 101)\r\nbuffer_size=16 # the buffer area size, default 16(MB)\r\nwebhook=False\r\nself_signed=False # Optional while webhook is False\r\ncert_key=your private cert path # Optional while webhook is False\r\ncert_pub=your public cert path # Optional while webhook is False\r\nload_cert=False # Optional while webhook is False\r\nserver_ip=your server ip address # Optional while webhook is False\r\nserver_port=your server port # Optional while webhook is False\r\nlocal_address=webhook local address # Optional while webhook is False\r\nlocal_port=webhook local port # Optional while webhook is False\r\nsecret_token=webhook secret token\r\ndebug=False\r\nhide_info=False\r\ndrop_pending_updates=False\r\nlocal_api_server=local api server address # [Optional]\r\nupdates_chat_member=False # [Optional]\r\nproxy=socks5h://user:pass@host:port # [Optional]\r\n```\r\n\r\n**\u5728 `1.13.0` \u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u652f\u6301\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6\u3002\uff08\u9ed8\u8ba4\u4e3aPolling\u6a21\u5f0f\uff09**\r\n\r\n1.\u5728\u547d\u4ee4\u884c\u672a\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u5728\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u4e0b\u4e0d\u5b58\u5728\u914d\u7f6e\u6587\u4ef6\u65f6\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6 `config.cfg`\u3002\r\n\r\n* \u5728Linux\u4e0b\uff0c\u4f1a\u81ea\u52a8\u5728\u7528\u6237\u76ee\u5f55\u4e0b\u521b\u5efa\u6587\u4ef6\u5939 `.teelebot` \uff0c\u5e76\u751f\u6210\u914d\u7f6e\u6587\u4ef6 `config.cfg`\r\n\r\n* \u5728Windows\u4e0b\uff0c\u5219\u4f1a\u5728 `C:\\Users\\<username>`  \u76ee\u5f55\u4e0b\u521b\u5efa\u6587\u4ef6\u5939 `.teelebot` \uff0c\u5e76\u751f\u6210\u914d\u7f6e\u6587\u4ef6 `config.cfg` \r\n\r\n2.\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\r\n\r\nLinux \u548c Windows \u90fd\u53ef\u5728\u547d\u4ee4\u884c\u901a\u8fc7\u53c2\u6570\u624b\u52a8\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\uff0c\u547d\u4ee4\u683c\u5f0f\uff1a\r\n\r\n```\r\nteelebot -c/--config <configure file path>\r\n```\r\n\r\n\u8def\u5f84\u5fc5\u987b\u4e3a\u7edd\u5bf9\u8def\u5f84\uff0c\u5e76\u4e14\u914d\u7f6e\u6587\u4ef6\u540d\u4e5f\u5e94\u5f53\u5305\u542b\u5728\u8def\u5f84\u5185\uff0c\u6b64\u60c5\u51b5\u4e0b\u4f1a\u5728\u6307\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u5b58\u5728\u65f6\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6 \u3002\r\n\r\n\r\n\r\n#### \u56db\u3001\u5bfc\u5165\u4f7f\u7528\r\n\r\n```python\r\n# \u5bfc\u5165Bot\u7c7b\r\nfrom teelebot import Bot\r\n\r\n# \u5b9e\u4f8b\u5316Bot\u7c7b\r\n# \u4e0d\u4f20\u53c2\u6570\u65f6\u4f1a\u4f7f\u7528teelebot\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u4e0b\u7684\u914d\u7f6e\u6587\u4ef6\u5b9e\u4f8b\u5316Bot\u7c7b\r\n# \u5728v2.2.0\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u53ef\u4f20\u9012\u53c2\u6570\u8986\u76d6\u914d\u7f6e\u6587\u4ef6\u7684\u8bbe\u5b9a\uff0c\u53ef\u8986\u76d6\u7684\u53c2\u6570:\r\n#     Bot(key: str = None, debug: bool = False, proxies: dict = None)\r\nbot = Bot()\r\n\r\n# \u4f7f\u7528Bot\u7c7b\r\nbot.sendMessage(chat_id=\"chat_id\", text=\"Hello World!\")\r\n```\r\n\r\n**Tip: \u5bfc\u5165\u4f7f\u7528\u65f6\u9700\u8981\u786e\u4fdd\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u4e2d\u5b58\u5728\u914d\u7f6e\u6587\u4ef6,\u5e76\u4e14\u5fc5\u987b\u7684\u5b57\u6bb5\u5df2\u7ecf\u586b\u5199**\r\n\r\n\r\n\r\n\r\n\r\n## \u8054\u7cfb\u6211\r\n\r\n* Email\uff1ahi#ojoll.com ( # == @ )\r\n* Blog:    [\u5317\u53ca](https://ojoll.com)\r\n* Telegram Group\uff1a[teelebot official](https://t.me/teelebot_official)\uff08t.me/teelebot_official\uff09\r\n* ~~Telegram Group\uff1a[teelebot\u4f53\u9a8c\u7fa4](http://t.me/teelebot_chat)\uff08t.me/teelebot_chat\uff09~~\r\n* \u5176\u4ed6\uff1a\u672crepo \u7684 Issue\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "teelebot is a Python-based Telegram Bot framework with a plugin system that supports hot reload and hot loading.",
    "version": "2.5.0",
    "project_urls": {
        "Homepage": "https://ojoll.com"
    },
    "split_keywords": [
        "teelebot",
        "telegram",
        "bot",
        "telegram",
        "bot",
        "api",
        "telegram"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aaf6cfa0d85ec45945483319865576692383fee5316c11aced274b4ff4eb7578",
                "md5": "e6d519e06612c87a1140f193be49e8b3",
                "sha256": "69dc79d4d2e0fd8a0d7b0295cb9ce120e5025e0fe328e0023179a30d37f190a0"
            },
            "downloads": -1,
            "filename": "teelebot-2.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6d519e06612c87a1140f193be49e8b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 43082,
            "upload_time": "2024-03-04T06:06:46",
            "upload_time_iso_8601": "2024-03-04T06:06:46.337314Z",
            "url": "https://files.pythonhosted.org/packages/aa/f6/cfa0d85ec45945483319865576692383fee5316c11aced274b4ff4eb7578/teelebot-2.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 06:06:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "teelebot"
}
        
Elapsed time: 0.18177s