{"id":13758373,"url":"https://github.com/jpiontek/bitter-irc","last_synced_at":"2025-10-09T02:37:03.254Z","repository":{"id":57526517,"uuid":"68254497","full_name":"jpiontek/bitter-irc","owner":"jpiontek","description":"Bitter IRC is a streamlined IRC library specifically designed for Twitch IRC servers written in Go (golang).","archived":false,"fork":false,"pushed_at":"2017-05-27T03:55:37.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-10T08:34:19.573Z","etag":null,"topics":["bot","twitch","twitch-irc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpiontek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-15T00:28:03.000Z","updated_at":"2019-04-09T17:27:33.000Z","dependencies_parsed_at":"2022-09-07T02:52:03.381Z","dependency_job_id":null,"html_url":"https://github.com/jpiontek/bitter-irc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jpiontek/bitter-irc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpiontek%2Fbitter-irc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpiontek%2Fbitter-irc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpiontek%2Fbitter-irc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpiontek%2Fbitter-irc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpiontek","download_url":"https://codeload.github.com/jpiontek/bitter-irc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpiontek%2Fbitter-irc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000780,"owners_count":26082906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","twitch","twitch-irc"],"created_at":"2024-08-03T13:00:28.723Z","updated_at":"2025-10-09T02:37:03.227Z","avatar_url":"https://github.com/jpiontek.png","language":"Go","funding_links":[],"categories":["Libraries"],"sub_categories":["Golang"],"readme":"# BitterBot IRC Client\n\nBitter IRC is a streamlined IRC library specifically designed for Twitch's IRC servers.\nTo see an example application go [here](https://github.com/jpiontek/bitter-irc-example).\n\n## Example\n```go\nimport \"github.com/jpiontek/bitter-irc\"\n\n// Your OAuth Key\noauthKey := \"my_oauth_key\"\n// Your account username\nusername := \"fred_bot\"\n// The channel you'd like to listen to\nchannelName := \"awesome_streamer\"\n// Use TLS\ntls := true\n\n// Create a new channel by supplying the necessary info and the Logger digester.\nchannel := birc.NewTwitchChannel(channelName, username, oauthKey, tls, birc.Logger)\n\n// Connect estblishes the underlying TCP connection\nerr := channel.Connect()\nif err != nil {\n  // Handle error\n}\n\n// Authenticate will send the proper credentials and join the channel.\nerr := channel.Authenticate()\nif err != nil {\n  // Handle error\n}\n\n// Listen begins listening on the channel and handling messages. It is blocking,\n// so you may want to wrap it in a go routine if you intend to continue executing\n// on the current thread.\nerr := channel.Listen()\nif err != nil {\n // Channel eventually had an error.\n}\n```\n\n## Digesters\nDigesters are simply functions used to handle incoming IRC messages. They have the signature:\n```go\ntype Digester func(m Message, c ChannelWriter)\n```\n\nYou can pass in any number of digesters to the NewTwitchChannel function. They **MUST** be threadsafe as\nthey will be called by multiple go routines. An example of the Logger digester:\n\n```go\nfunc Logger(m Message, w ChannelWriter) {\n\tif m.Username != \"\" \u0026\u0026 m.Content != \"\" {\n\t\tfmt.Printf(\"\\n%s %s: %s\", m.Time.Format(timeFormat), m.Username, m.Content)\n\t}\n}\n```\n\nYou can see the Logger digester just prints a formatted string to stdout if the message has a username and\nsome sort of content.\n\nThe ChannelWriter is an interface that represents a channel you can write to via the Send function.\n\n```go\n// Simply checks if the content of someone's message is !command. If so then\n// the digester replies in the channel with \"Executing command!\".\nif m.Content == \"!command\" {\n  w.Send(\"Executing command!\")\n}\n```\n\nThe ChannelWriter also supports SendMessage. You can send any message struct\nvia this function.\n\n```go\nmessage := \u0026birc.Message{\n  Command: \"PONG\",\n  Content: \"tmi.twitch.tv\",\n}\n\nerr := w.SendMessage(message)\n```\n\nThe ChannelWriter also supports retrieving the Channel's configuration.\n\n```go\nconfig := w.GetConfig()\n```\n\nThe Message struct passed into each digester:\n```go\ntype Message struct {\n  Name     string\n  Username string\n  Content  string\n  Command  string\n  Host     string\n  Params   []string\n  Time     time.Time\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpiontek%2Fbitter-irc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpiontek%2Fbitter-irc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpiontek%2Fbitter-irc/lists"}