Skip to main content

console adapter for nonebot2

Project description

nonebot-adapter-console

NoneBot-Adapter-Console

✨ Console 适配 ✨

配置

修改 NoneBot 配置文件 .env 或者 .env.*

Driver

参考 driver 配置项,直接使用 None 驱动器:

DRIVER=~none

console_bot_id

配置 Bot 的 ID, 默认为 robot

console_bot_name

配置 Bot 的名称, 默认为 Bot

console_strict_tome

配置是否使用严格的 ToMe 规则。默认为 False

启用后,在群聊中发送的消息需要增加 @{bot_id} 才能满足 ToMe 的条件。

示例

from nonebot import on_command
from nonebot.adapters.console import Bot
from nonebot.adapters.console.event import MessageEvent
from nonebot.adapters.console.message import MessageSegment


matcher = on_command("test")

@matcher.handle()
async def handle_receive(bot: Bot, event: MessageEvent):
      await bot.send(event, MessageSegment.text("Hello, world!"))

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_adapter_console-0.8.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

nonebot_adapter_console-0.8.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_adapter_console-0.8.0.tar.gz.

File metadata

  • Download URL: nonebot_adapter_console-0.8.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.25.4 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for nonebot_adapter_console-0.8.0.tar.gz
Algorithm Hash digest
SHA256 236135b2dfc606c5d02f3761389fba2bdc0dc24b7d4e6408e74c4122abecd4ad
MD5 032932fee340b9f9cffc1f423f4512ab
BLAKE2b-256 c61f015f78e3a17d54584069ba7ea87a8366b04535fa82c1ac8f5608ab437f65

See more details on using hashes here.

File details

Details for the file nonebot_adapter_console-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_adapter_console-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d2a6b1812ed128d8a0eeaf09eb49379b4719ec81f943563b8114ff6a0ae5f87
MD5 dfe597807d59c35de539dc2e6a4ddb10
BLAKE2b-256 84f7fe8254d9a5d0b08b11a19e3a5e22adc180620955d3580ac84c8597508329

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