Skip to content

An example "bot" using the bitter-irc library to interact with Twitch's IRC servers.

License

Notifications You must be signed in to change notification settings

jpiontek/bitter-irc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Bitter IRC Example Application

This is an example application that utilizes the bitter-irc library to build a small "bot".

Running

To run execute the following command in the repository root after cloning to your local machine.

go run main.go -oauth=token -clientid=id -username=user -channels=example,channels

As you can see you need to pass in a few flags:

  • oauth
  • clientid
  • usrename
  • channels

These are pretty self-explanatory. "oauth" is your oauth token. "channels" is a comma separated list of values to join multiple channels.

Explanation

The application will connect to multiple Twitch IRC channels and start pumping the messages to stdout via the logger digester. It also has a pingHandler digester that will respond to a user that executes the !ping command in a channel.

When running you'll see log messages in your terminal that look something like this:

2017-01-10 12:32:10 [user] Kappa

And an example of the pingHandler :

2017-01-10 12:32:10 [user] !ping
2017-01-10 12:32:10 [bot] pong @user

Notes

All digesters must be threadsafe. They will be called from multiple go routines as new messages come in. Keep this in mind if you create a digester that interacts with any type of unsafe struct.

About

An example "bot" using the bitter-irc library to interact with Twitch's IRC servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages