{"id":16217249,"url":"https://github.com/synodriver/nonebot_plugin_mqtt","last_synced_at":"2025-03-19T10:30:43.308Z","repository":{"id":42476384,"uuid":"334331935","full_name":"synodriver/nonebot_plugin_mqtt","owner":"synodriver","description":"iot plugin for nonebot2","archived":false,"fork":false,"pushed_at":"2023-09-06T16:08:13.000Z","size":55,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T17:56:23.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synodriver.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-30T05:01:41.000Z","updated_at":"2024-08-25T04:21:33.000Z","dependencies_parsed_at":"2024-10-27T20:30:52.917Z","dependency_job_id":"cf8279a8-dde8-4e72-ba64-01af08231c47","html_url":"https://github.com/synodriver/nonebot_plugin_mqtt","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"ce41ae5641537162111dd436ef60f8b6c3bac1aa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fnonebot_plugin_mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fnonebot_plugin_mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fnonebot_plugin_mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fnonebot_plugin_mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synodriver","download_url":"https://codeload.github.com/synodriver/nonebot_plugin_mqtt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982182,"owners_count":20378605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T11:26:17.218Z","updated_at":"2025-03-19T10:30:43.043Z","avatar_url":"https://github.com/synodriver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nonebot_plugin_mqtt\n\n[![pypi](https://img.shields.io/pypi/v/nonebot-plugin-mqtt.svg)](https://pypi.org/project/nonebot-plugin-mqtt/)\n![python](https://img.shields.io/pypi/pyversions/nonebot-plugin-mqtt)\n[![license](https://img.shields.io/github/license/synodriver/nonebot_plugin_mqtt.svg)](https://raw.githubusercontent.com/synodriver/nonebot_plugin_mqtt/main/LICENSE)\n\n- 基于[nonebot2](https://github.com/nonebot/nonebot2) 和 [gmqtt](https://github.com/wialon/gmqtt)\n\n## 功能\n\n- 将 nonebot 接入 mqtt 网络\n\n## 开始使用\n\n- 使用 nb-cli 安装\n\n```bash\nnb plugin install nonebot-plugin-mqtt\n```\n\n- 参照下文在 nonebot2 项目的环境文件 .env.\\* 中添加配置项\n\n## 配置项\n\n```text\nMQTT_TOPIC          # MQTT 订阅 Topic\nMQTT_CLIENT_ID      # MQTT 订阅 Client ID\nMQTT_HOST           # MQTT Broker 地址\nMQTT_PORT           # MQTT Broker 端口\n\nMQTT_USER           # MQTT 可选验证项\nMQTT_PASSWORD\n```\n\n## 在其他插件中使用\n\n```python\nfrom nonebot import require\n\nrequire(\"nonebot_plugin_mqtt\")\nfrom nonebot_plugin_mqtt import mqtt_client\n\nmqtt_client.publish(topic, payload=payload, qos=0, retain=False)\nmqtt_client.subscribe(topic, qos=1)\n\n# 自定义回调\nmqtt_client.on_message = on_message\nmqtt_client.on_connect = on_connect\n```\n\n## 特别感谢\n\n- [Mrs4s/go-cqhttp](https://github.com/Mrs4s/go-cqhttp)\n- [nonebot/nonebot2](https://github.com/nonebot/nonebot2)\n\n## 优化建议\n\n可以来抓更多网站的接口 or 汇报 bug or pr\n![](https://i.pixiv.cat/img-original/img/2019/09/01/05/00/42/76563606_p0.png \"呐呐呐,来pr的话~就给大哥哥透噢\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fnonebot_plugin_mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynodriver%2Fnonebot_plugin_mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fnonebot_plugin_mqtt/lists"}