All Projects → go-irc → Irc

go-irc / Irc

Licence: mit
A simple go irc library meant to be a building block for other projects

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Irc

IceChat
IceChat IRC Client
Stars: ✭ 68 (-24.44%)
Mutual labels:  irc, irc-client
Kirc
A tiny IRC client written in POSIX C99.
Stars: ✭ 416 (+362.22%)
Mutual labels:  irc, irc-client
girc
💬 A simple chat client in Python/Twisted
Stars: ✭ 16 (-82.22%)
Mutual labels:  irc, irc-client
irc.dart
Dart IRC Library
Stars: ✭ 45 (-50%)
Mutual labels:  irc, irc-client
Girc
💣 girc is a flexible IRC library for Go 👌
Stars: ✭ 59 (-34.44%)
Mutual labels:  irc, irc-client
yesbot
IRC Bot Written in Prolog
Stars: ✭ 19 (-78.89%)
Mutual labels:  irc, irc-client
Revolution Irc
A modern Android IRC client. #revolutionirc on Freenode.
Stars: ✭ 325 (+261.11%)
Mutual labels:  irc, irc-client
TwitchPy
This is a package you can use to connect with the Twitch API, manage a channel, create bots, etc
Stars: ✭ 22 (-75.56%)
Mutual labels:  irc, irc-client
Quassel
Quassel IRC: Chat comfortably. Everywhere.
Stars: ✭ 589 (+554.44%)
Mutual labels:  irc, irc-client
Kiwiirc
🥝 Next generation of the Kiwi IRC web client
Stars: ✭ 488 (+442.22%)
Mutual labels:  irc, irc-client
erk
Ərk is an open source, cross-platform IRC client written in Python 3, Qt 5, and Twisted.
Stars: ✭ 21 (-76.67%)
Mutual labels:  irc, irc-client
Convos
Convos 👥 is the simplest way to use IRC in your browser
Stars: ✭ 789 (+776.67%)
Mutual labels:  irc, irc-client
swirc
Lightweight terminal based ICB and IRC client
Stars: ✭ 20 (-77.78%)
Mutual labels:  irc, irc-client
Alectro
A terminal IRC client in Rust.
Stars: ✭ 47 (-47.78%)
Mutual labels:  irc, irc-client
pesterchum-alt-servers
Instant messaging client copying the look and feel of clients from Andrew Hussie's webcomic Homestuck.
Stars: ✭ 37 (-58.89%)
Mutual labels:  irc, irc-client
Birch
An IRC client written in bash
Stars: ✭ 256 (+184.44%)
Mutual labels:  irc, irc-client
communi-sailfish
The first and foremost IRC client for Sailfish OS
Stars: ✭ 34 (-62.22%)
Mutual labels:  irc, irc-client
jj
An evolution of the suckless ii(1) file-based IRC client
Stars: ✭ 80 (-11.11%)
Mutual labels:  irc, irc-client
Thelounge
💬 ‎ Modern, responsive, cross-platform, self-hosted web IRC client
Stars: ✭ 4,618 (+5031.11%)
Mutual labels:  irc, irc-client
Dispatch
Web-based IRC client in Go.
Stars: ✭ 595 (+561.11%)
Mutual labels:  irc, irc-client

go-irc

GoDoc Build Status Coverage Status

This package was originally created to only handle message parsing, but has since been expanded to include a small abstraction around a connection and a simple client.

This library is not designed to hide any of the IRC elements from you. If you just want to build a simple chat bot and don't want to deal with IRC in particular, there are a number of other libraries which provide a more full featured client if that's what you're looking for.

This library is meant to stay as simple as possible so it can be a building block for other packages.

This library aims for API compatibility whenever possible. New functions and other additions will most likely not result in a major version increase unless they break the API. This library aims to follow the semver recommendations mentioned on gopkg.in.

Due to complications in how to support x/net/context vs the built-in context package, only go 1.7+ is officially supported.

Import Paths

All development happens on the master branch and when features are considered stable enough, a new release will be tagged.

  • gopkg.in/irc.v3 should be used to develop against the commits tagged as stable
  • In previous versions, github.com/go-irc/irc used to be able to be used to develop against the master branch but module support in go seems to have broken this.

Development

In order to run the tests, make sure all submodules are up to date. If you are just using this library, these are not needed.

Example

package main

import (
	"log"
	"net"

	"gopkg.in/irc.v3"
)

func main() {
	conn, err := net.Dial("tcp", "chat.freenode.net:6667")
	if err != nil {
		log.Fatalln(err)
	}

	config := irc.ClientConfig{
		Nick: "i_have_a_nick",
		Pass: "password",
		User: "username",
		Name: "Full Name",
		Handler: irc.HandlerFunc(func(c *irc.Client, m *irc.Message) {
			if m.Command == "001" {
				// 001 is a welcome event, so we join channels there
				c.Write("JOIN #bot-test-chan")
			} else if m.Command == "PRIVMSG" && c.FromChannel(m) {
				// Create a handler on all messages.
				c.WriteMessage(&irc.Message{
					Command: "PRIVMSG",
					Params: []string{
						m.Params[0],
						m.Trailing(),
					},
				})
			}
		}),
	}

	// Create the client
	client := irc.NewClient(conn, config)
	err = client.Run()
	if err != nil {
		log.Fatalln(err)
	}
}

Major Version Changes

v1

Initial release

v2

  • CTCP messages will no longer be rewritten. The decision was made that this library should pass through all messages without mangling them.
  • Remove Message.FromChannel as this is not always accurate, while Client.FromChannel should always be accurate.

v3

  • Import path changed back to gopkg.in/irc.v3 without the version suffix.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].