Skip to main content

NoneBot 暗语

Project description

NoneBot-Plugin-Argot

✨ NoneBot2 暗语消息 ✨

pypi python uv-managed alc-resolved
NoneBot Registry Supported Adapters
📸 演示与预览   |   📦️ 下载插件   |   💬 加入交流群

📖 介绍

NoneBot2 暗语消息支持

[!IMPORTANT] 收藏项目,你将从 GitHub 上无延迟地接收所有发布通知~⭐️

starify
Star History

💿 安装

以下提到的方法任选 其一 即可

[推荐] 使用 nb-cli 安装 在 Bot 的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-argot
使用包管理器安装
pip install nonebot-plugin-argot
# or, use poetry
poetry add nonebot-plugin-argot
# or, use pdm
pdm add nonebot-plugin-argot
# or, use uv
uv add nonebot-plugin-argot

🎉 使用

本插件基于 plugin-alconna,为 NoneBot 提供了一个新的消息段 Argot

@dataclass
class Argot(Segment):
    name: str
    segment: str | Segment | list[Segment]
    command: str | Literal[False] | None = field(default=None, kw_only=True)
    expired_at: int | timedelta = field(default_factory=timedelta, kw_only=True)
    extra: dict[str, Any] = field(default_factory=dict, kw_only=True)
  • name: 暗语名称
  • segment: 暗语包含的消息段
  • command: 触发暗语的指令(跟随 COMMAND_START 配置)
    • None: 使用 name 作为指令名
    • False: 禁止通过指令获取暗语
  • expired_at: 过期时间
  • extra:暗语事件中储存的额外数据

可以通过 on_argot 监听暗语事件

@on_argot("name")
async def _(event: ArgotEvent):
  ...

示例:👉 传送门

📸 效果图

example example

💖 鸣谢

贡献者们

contributors sponsors

感谢这些大佬对本项目作出的贡献:

contributors

📄 许可证

本项目使用 MIT 许可证开源

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

nonebot_plugin_argot-0.2.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_argot-0.2.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_argot-0.2.1.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_argot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 24b32cd620904d8c05f74b3d87ac962821f2636d00f05d91354570dea7cf78a4
MD5 8d9d09315694e142f5120d5f1b5e25d6
BLAKE2b-256 15cc87dcb611f581cec63cbc62ec1b2050cac0b9237438dafe8a272be1b71ba2

See more details on using hashes here.

File details

Details for the file nonebot_plugin_argot-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_argot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11e2f3bea0c63541b3faf923270bc7ca5f61dcd28b267a8a23df99a7199baac8
MD5 a87c0c744e33dafde1070fc08222ca48
BLAKE2b-256 a0ab2fa18f1a69a6c86879e940859fa3e99494440c1c1d4c5c8db003a03c187b

See more details on using hashes here.

Supported by

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