Pancakes-Labs/astrbot_plugin_proactive_chat

一个能让 Bot 在私聊和群聊中发起主动消息的插件,拥有上下文感知、持久化数据、动态情绪、免打扰时段和 TTS 集成。还有独立 WebUI,可进行个性化配置。 An AstrBot plugin that enables Bot to send proactive messages in private and group chats, featuring context awareness, persistent data, dynamic emotions, do-not-disturb periods, and TTS integration. It also boasts an independent WebUI for personalized.

What it solves

AstrBot is a chatbot framework, but by default its bot only replies when someone messages it first. If you go quiet for a while, the bot stays silent, which feels cold and unnatural. This plugin fills that gap: it gives your bot the ability to proactively start a conversation on its own, so the bot feels more like a living companion that cares about you rather than a passive reply machine.

How it works

The plugin monitors each enabled chat session (private chats and group chats). When a session has been silent for longer than a configured "quiet" period, the plugin schedules an automatic proactive message at a random time chosen between a minimum and maximum interval. The message is generated by the LLM using several inputs:

  • The personality/persona you set for that session, so the bot stays in character.
  • Historical context (either the ongoing LLM conversation history, recent real platform messages, or a hybrid of both), so the bot references actual past topics instead of sending generic greetings.
  • A special "unanswered counter" that tracks how many times the bot has reached out without a reply. You can use this counter in your prompt to create emotional depth (e.g., a hint of longing or disappointment).
  • Placeholders like current time and the unanswered count are injected into your custom prompt.

The plugin also supports a do-not-disturb time window, automatic task restoration after restarts, optional TTS voice output, and splitting long replies into multiple short messages with simulated typing delays. You can manage everything either through AstrBot's native config page or through a dedicated WebUI console that shows real-time task status, countdowns, notifications, and per-session overrides.

To set up a session, you get its unique UMO identifier using the /sid command in chat, then add that UMO to the plugin's session list. The plugin supports many platforms (QQ official bot, OneBot v11, Telegram, Feishu, DingTalk, etc.) but some platforms have caveats, and each is listed in a compatibility table in the README.

Who it's for

This plugin is for AstrBot users who want their bot to feel more human and emotionally present - for example, people who want an AI companion that checks in on them, or who want their bot to naturally keep group conversations alive. It requires some willingness to tune prompts (the README notes that good prompts are essential for natural results) and is aimed at users who have basic AstrBot setup experience.

Highlights

  • Proactive messaging: the bot starts conversations on its own after a random, configurable silence period, using context-aware prompts rather than canned greetings.
  • Multi-session and fully isolated: supports many private and group chats at once, each with its own state, counters, triggers, persona, and configuration.
  • Emotional depth via unanswered counter: a built-in counter feeds into your prompt so the bot can express subtle emotions like missing you or mild confusion when you don't reply.
  • Persistent and interruption-friendly: all pending proactive tasks survive AstrBot restarts and plugin reloads.
  • Modern WebUI console: a built-in control panel with task management, countdown timers, notification center, inline documentation browsing, and per-session config overrides.
  • Extras: TTS integration, segmented replies with typing simulation, quiet hours, auto-trigger on startup, and compatibility with other plugins that decorate outgoing messages.

Related

  • Project
  • Project
  • Project
  • Project
  • Project