ircctcp

package
v0.0.0-...-1a94ce6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ircctcp encodes and decodes CTCP payloads and provides optional auto-replies to CTCP queries.

Index

Constants

View Source
const Marker = "\x01"

Marker is the byte that delimits a CTCP payload.

Variables

This section is empty.

Functions

func Unwrap

func Unwrap(payload string) (cmd, args string, ok bool)

Unwrap returns (command, args, true) if payload is a CTCP message. The command is upper-cased.

func Wrap

func Wrap(command, args string) string

Wrap encodes command and args into a CTCP payload delimited by Marker.

Types

type AutoReplies

type AutoReplies struct {
	Version    string
	Source     string
	UserInfo   string
	ClientInfo string
	Time       bool
	Ping       bool
	Finger     string
}

AutoReplies controls which CTCP queries get an automatic NOTICE response. The zero value disables all auto-replies.

func (AutoReplies) Reply

func (a AutoReplies) Reply(command, args string) (replyArgs string, ok bool)

Reply returns the reply arguments for command and reports whether an auto-reply is configured for it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL