Hanna Bot

Interact with Hanna IRC Bot via its REST API

Overview

The Hanna Bot node allows interaction with an IRC bot via its REST API, enabling automation and management of IRC channels and users. It supports sending messages and notices to channels or users, joining or leaving channels, changing the bot's nickname, sending raw IRC commands, and retrieving various IRC-related information such as user details, channel info, server status, and statistics.

This node is beneficial in scenarios where you want to automate IRC communications, monitor IRC network state, or integrate IRC interactions into broader workflows. For example, you can automatically send alerts to a specific IRC channel when certain events occur, retrieve user information for moderation purposes, or manage channel memberships programmatically.

Properties

Name Meaning
Target IRC channel (e.g., #general) or username to target. Used for operations: Send Message, Send Notice, Join Channel, Part Channel.
Message The message content to send. Can be AI-generated content. Used for operations: Send Message, Send Notice.

Output

The node outputs a JSON object containing:

  • success: Boolean indicating if the operation was successful.
  • operation: The performed operation name.
  • response: The raw response from the Hanna Bot API parsed as JSON.
  • timestamp: ISO string timestamp of when the operation was executed.

Additional fields depend on the operation:

  • For Send Message and Send Notice: includes target and message.
  • For Join and Part: includes channel and optionally reason for parting.
  • For Nick Change: includes newNick.
  • For Raw Command: includes command.
  • For List Channels: includes channelCount, channels array, totalUsers, and largestChannels (top 5 by user count).
  • For WHOIS: detailed user info including nick, user, host, real name, server info, operator status, idle time, and parsed channel modes.
  • For Server Info: server name, version, creation date, network, capabilities, and message of the day.
  • For Users: total user count, list of users, operator count, and away count.
  • For User Details: detailed info about a specific user.
  • For Statistics: counts of channels, users, connection time, messages sent/received, last activity.
  • For Errors: error count, list of errors, and errors grouped by type.
  • For Channel Info: channel details including topic, user count, modes, creation date, and parsed user modes.
  • For Comprehensive State: full snapshot of server, channels, users, errors, statistics, and summary counts.

The node does not output binary data.

Dependencies

  • Requires an API key credential to authenticate with the Hanna Bot REST API.
  • The node expects the Hanna Bot API URL and token to be configured in credentials.
  • No other external dependencies are required.

Troubleshooting

  • Invalid Operation Error: If an unsupported operation is selected, the node throws an error indicating "Invalid operation". Ensure the operation name matches one of the supported options.
  • Authentication Failures: Errors related to authorization usually mean the API token is missing, invalid, or expired. Verify the API key credential configuration.
  • Network Issues: Connection failures to the Hanna Bot API endpoint may occur due to incorrect URL or network problems. Confirm the API URL is correct and reachable.
  • Malformed Responses: If the API returns unexpected data, parsing errors might happen. Check the Hanna Bot server logs and ensure the API is functioning correctly.
  • Missing Required Parameters: Operations like Send Message require target and message. Omitting these will cause errors. Always provide required inputs.

Links and References

Discussion