quip (verb): make a witty remark
An intelligent, sarcastic IRC bot powered by OpenAI-compatible APIs that brings personality and fun to your IRC channels. QuipBot can engage in conversations and perform various automated actions while maintaining a witty persona.
The bot is designed to encourage and deliver fun channel conversation by kickstarting and participating in chatter.
Many features can be toggled on and off and specific behaviour may be fine-tuned to suit your requirements, including for specific channels.
By default, the bot will operate like the below:
-
After entering the channel, announce a fun AI generated entrance message
-
Every
idle_chat_intervalseconds, speak a fun conversation starting message if the channel has been idle for more thanidle_chat_timeseconds. -
Every
random_action_intervalseconds, if the channel has been idle for more thanidle_chat_timeseconds, randomly choose to set a fun AI generated topic or kick a random non-opped (and non-admin) user from the recent chat history (from lastchannels.chat_historylines) -
Respond when someone speaks to or about the bot and continue chatting every
ai_continue_freqseconds forai_continue_minsminutes after the last bot mention. -
Allow ops and admins to use the
@bootcommand to randomly kick a non-opped and non-admin user from the chat history with a fun kick message.
All commands can be configured to require specific user permissions, being either admin, op, voice, or any.
Admin supercedes op and voice; op supercedes voice; voice supercedes any.
The bot supports the following commands:
@boot: Kick a random non-opped and non-admin user from the chat history with a fun kick message.@topic [topic]: Set a custom topic if given, otherwise automate a fun AI generated topic for the channel.@sleep <mins>: Put the bot to sleep for a specified amount of time.@wake: Wake the bot up from sleep.@say <message>: Speak a message to the channel.@reload: Reload both configuration and code modules while preserving network state. See Hot Reloading Documentation.@rehash: Reload only the configuration file.@die: Shutdown the bot.@jump [server]: Jump to a specific server or the next server in the list.@var <variable>: Print the value of a variable to the log.@config <variable>: Print the value of a configuration variable to the log.@help [command]: Show the help message for a given command.
- Dynamic code reloading without bot restart
- Preserves network connections and state
- Reloads configuration and module changes
- Maintains chat history and user tracking
- See Hot Reloading Documentation for details
- Responds to direct messages (prefix with botnick:)
- Responds to mentions of its nickname when enabled (configurable per channel)
- Generates contextually aware responses using OpenAI-compatible APIs
- Maintains conversation history per channel for context
- Configurable AI personality and response style
- Supports multiple AI providers (OpenAI, Perplexity, Grok)
- Selective chat history context for different interaction types
- Configurable random response delays to appear more natural
- Sleep and wake commands to create quiet times
- Avoids responding to its own messages
- Tracks user activity for targeted interactions
- Auto-joins configured channels after server registration
- Handles channel invites to configured channels
- Tracks user presence and permissions
- Maintains separate chat history per channel
- Supports channel-specific configurations
- User and service bot ignoring capabilities
- Smart message rate limiting
- Joins channels only after proper registration
- Handles channel keys and invites
- Tracks user modes (op, voice)
- Random idle chat when channels are inactive
- Random topic changes with AI-generated content
- Funny kick messages with AI-generated reasons
- Configurable intervals for automated actions per channel
- Smart flood protection for both channels and private messages
- All actions respect channel operator status
- Supports markdown-style formatting in messages
- Bold text using asterisks
- Underlined text using underscores
- Automatic quote removal for cleaner responses
- Intelligent message splitting at sentence boundaries
- Rate limiting with burst allowance
- Ignored nick filtering
- Context-aware responses
- Automatic server reconnection
- Fallback server support
- Robust flood protection
- Graceful error recovery
- Detailed debug logging
- YAML-based configuration file
- Per-channel settings override global defaults
- Configurable timers and intervals
- Custom AI prompts per channel
- Multiple server support with failover
- Configurable rate limiting and flood protection
Configuration is handled via the config.yaml file.
Custom configuration can be loaded from the command line with the -c option.
nick: Bot nicknamerealname: Bot real name (gecos)ident: Bot identusermode: User mode to set after connecting (e.g. "+ix" for invisible and external immunity)post_connect_commands: Commands to send after connecting (before joining channels)sasl: SASL Authentication (optional)cmd_prefix: Command prefix (e.g., !, ., @, $, etc)admins: List of bot administrators (can use all commands)servers: List of IRC servers to connect tochannels: List of channels to joinlog_level: Logging verbosity level (DEBUG, INFO, WARNING, ERROR, CRITICAL)log_file: Log file namelog_raw: Log raw IRC messages (true/false)log_api: Log AI queries (true/false)pid_file: Path to PID file when running as daemon
The below can be set at a global level and overridden per channel:
ai_service: AI service settingsai_key: AI API key settingsai_model: AI model settingsai_delay: Response delay rangeai_entrance: Entrance settingsai_prompt_entrance: Entrance prompt settingsai_prompt_default: Default prompt settingsai_prompt_idle: Custom prompt for idle chatai_prompt_topic: Custom prompt for topic generationai_prompt_kick: Custom prompt for kick reasonsai_mention: Whether to respond when the bot's nickname is mentionedai_context_direct: Whether to include chat history for direct messagesai_context_mention: Whether to include chat history for mentions of the bot's nickai_context_idle: Whether to include chat history for idle chatai_context_topic: Whether to include chat history for topic generationai_nicklist: Whether to send the channel's nicklist to the AI for added contextchat_history: Lines to retain from chat history for AI contextignore_nicks: Nicks to ignore (in addition to global ignores)ignore_regex: Lines to ignore by regex patternfloodpro: Flood protection settingsidle_chat_interval: Time between random chat messages (0 to disable)random_action_interval: Time between random actionsrandom_actions: Whether to enable random actions (kicks, topic changes)idle_chat_time: Idle time required to trigger chat or random actions (0 to disable)commands: Allowing individual commands to be toggled or have permissions changed per channel
- Maintains conversation context per channel
- Avoids responding to its own messages
- Tracks user activity for targeted interactions
- Supports different AI models and providers
- Configurable personality and response style
- Selective chat history context
- Random response delays
- Rate limiting with burst allowance
- Intelligent message splitting
- Ignored nick filtering
- Flood protection
- Context-aware responses
- Joins channels only after proper registration
- Handles channel keys and invites
- Tracks user modes (op, voice)
- Maintains separate history and settings per channel
- Smart flood protection with configurable thresholds
- Idle chat when channel is inactive
- Topic changes with AI-generated content
- Random kicks with funny reasons
- All actions respect channel operator status
- Configurable intervals per channel
- Automatic server reconnection
- Fallback server support
- Robust flood protection
- Graceful error recovery
- Detailed debug logging
- Create a new virtual environment:
python3 -m venv .venv- Activate the virtual environment:
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Configure your
config.yamlfile with appropriate settings:
cp config.yaml.example config.yaml
nvim config.yamlsource .venv/bin/activate
python3 -m quipbotStart the bot with the -h option to see the help message.
❯ python3 -m quipbot -h
Usage: quipbot [-h] [-n] [-c CONFIG]
QuipBot - An AI-powered IRC bot
Options:
-h, --help show this help message and exit
-n, --no-fork Do not fork to background (run in foreground)
-c, --config CONFIG Path to config file (default: config.yaml)The bot supports the following signals:
SIGHUP: Rehash the configuration file.SIGUSR1: Reload the config file and code modules.
Rehash Example:
kill -SIGHUP $(pgrep -f quipbot)Reload Example:
kill -USR1 $(pgrep -f quipbot)- Python 3.6+
- OpenAI API key (or other supported AI service)
- Required Python packages (see requirements.txt)
- Rust compiler
If you get an error about the Rust compiler, you need to install it.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shConsider increasing the log verbosity to DEBUG with the log_level setting in the config.yaml file to get more information about what the bot is doing.
The bot can be started in console mode with the following command:
python3 -m quipbot -cAlternatively, check the quip.log file for more information.
Feel free to submit issues and pull requests. The bot is designed to be easily extensible with new features and capabilities.
MIT License - See LICENSE file for details