A chat bot for YouTube, Discord and IRC.
Go
Switch branches/tags
Nothing to show
Clone or download
iopred Merge pull request #25 from titpetric/master
Update travis build environments
Latest commit 9bcaa64 Jun 26, 2018
Permalink
Failed to load latest commit information.
carbonitexplugin Delay carbonitex as startup can be slow. Show how many shards are con… Sep 17, 2016
chartplugin Fix chart plugin. Apr 30, 2018
cmd/bruxism Don't track presences.. This is mainly for Septapus because this kill… May 4, 2017
comicplugin Support animated emoji on comics. Jan 11, 2018
discordavatarplugin Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
emojiplugin Support hugeemoji. Jan 19, 2018
inviteplugin Don't embed the oauth link. May 21, 2017
liveplugin Stop sending live updates for old channels. May 4, 2017
mtgplugin Replace some usages of fmt for logging. Mar 21, 2016
musicplugin Fix musicplugin. Jan 11, 2018
mysonplugin Fix color for myson. Dec 11, 2016
numbertriviaplugin Improved help substantially, allowed it to be set to private only. Im… Apr 21, 2016
playedplugin Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
playingplugin Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
reminderplugin fix months. Oct 12, 2017
statsplugin Youtube will break long messages across multiple messages. Removed de… Dec 11, 2016
streamerplugin Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
topstreamersplugin Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
triviaplugin Fix malformed characters Dec 2, 2017
youtubejoinplugin Prevent a crash at startup. Update to channel type. Oct 8, 2017
.gitignore ignore vendored deps for now Jun 26, 2018
.travis.yml jung-kurt/gofpdf/fpdf depends on sort.SliceStable which was added in … Jun 26, 2018
LICENSE License Dec 29, 2015
README.md Update README.md Apr 3, 2017
bot.go Simplify plugin flow. Limit some plugins from private messages. Jan 3, 2017
commandplugin.go Simplify command parsing. Recovery fixes. Dec 28, 2016
discord.go Prevent a crash at startup. Update to channel type. Oct 8, 2017
helpplugin.go Clean up now bot owner is implicit. Jan 14, 2017
interfaces.go Support IsChannelOwner and convert some uses of permissions to isMode… Dec 11, 2016
irc.go Support IsChannelOwner and convert some uses of permissions to isMode… Dec 11, 2016
mockmessage.go add message and service mocks Jun 26, 2018
mockservice.go add message and service mocks Jun 26, 2018
simpleplugin.go Support stats for plugins. Oct 29, 2016
slack.go Support IsChannelOwner and convert some uses of permissions to isMode… Dec 11, 2016
youtube.go YouTube Message Channel() is now videoID, not liveChatID Jan 1, 2017
ytlivechannel.go Remove filteredVideoChans because bad Dec 12, 2016

README.md

Bruxism

A chat bot for YouTube, Discord and IRC.

GoDoc Go report Build Status

Current plugin support:

Commands are prefixed with @BotName.

  • emoji <emoji> - Returns a big version of an emoji. Please read the README in emojiplugin for installation notes.
  • help [<topic>] - Returns generic help or help for a specific topic. Available topics: comic,remind
  • invite <id> - Provides invite URL for the bot.
  • numbertrivia [<number>] - Returns trivia for a random number or a specified number if provided.
  • playing - Set which game the bot is playing on Discord. Only enabled for bot owner.
  • reminder <time> | <reminder> - Sets a reminder.
  • stats - Lists bot statistics.
  • streamer <streamername|streamerid> - Grabs details about a YouTube streamer.
  • topstreamers - List the current top streamers on YouTube Gaming.

eg: @BotName help

Also supports direct invites on Discord and support for announcing streamers going live on YouTube Gaming.

Usage:

Installation:

go get github.com/iopred/bruxism/cmd/bruxism

go install github.com/iopred/bruxism/cmd/bruxism

cd $GOPATH/bin

Setup

You must first generate a YouTube Oauth token in the Google Developer Console.

Go to Credentials and download the JSON config file and save it in $GOPATH/bin as youtubeoauth2config.json

./bruxism -youtubeurl

You will then be given a URL (and copied to clipboard), visit that URL and copy the code, then run:

./bruxism -youtubeauth <AUTH CODE>

Now the bot can be run:

./bruxism -youtubechannelids <youtube channel id1,youtube channel id2>

Important!

The account you choose during the oauth flow is the account that the bot will use to send messages.

If you are trying to test the bot, make sure the account you are sending messages with is different from the bot account.

Bruxism ignores messages from the bot account, so if you are sharing accounts all commands will be ignored.

Run as a Discord bot

./bruxism -discordtoken "Bot <discord bot token>"

It is suggested that you set -discordapplicationclientid if you are running a bot account, this will make inviteplugin function correctly.

It is suggested that you set -discordowneruserid as this prevents anyone from calling playingplugin.

To invite your bot to a server, visit: https://discordapp.com/oauth2/authorize?client_id=<discord client id>&scope=bot

Run as an IRC bot

./bruxism -ircserver <irc server> -ircusername <irc username> -ircchannels <#channel1,#channel2>

Run as a Slack bot

./bruxism -slacktoken <slack token>

It is suggested that you set -slackowneruserid.

Image uploads

Some plugins upload images to imgur (such as chartplugin), it's suggested that you run your bot with -imgurid <imgurid> to enable this.

Arguments:

  • youtubeurl - Outputs a new OAuth URL for YouTube and then exits.
  • youtubeauth - Exchanges the provided auth code for an oauth2 token.
  • youtubeconfig - The filename for your YouTube OAuth client JSON. (Download JSON in Google Developers Console -> Credentials).
  • youtubetoken - The filename to store the oauth2 token.
  • youtubelivechannelids - Comma separated list of channel ids to poll.
  • discordtoken - Sets the Discord token.
  • discordemail - Sets the Discord account email.
  • discordpassword - Sets the Discord account password.
  • discordclientid - Sets the Discord client id.
  • ircserver - Sets the IRC server.
  • ircusername - Sets the IRC user name.
  • ircpassword - Sets the IRC password.
  • ircchannels - Comma separated list of IRC channels.
  • imgurid - Sets the Imgur client id, used for uploading images to imgur.
  • imguralbum - Sets an optional the Imgur album id, used for uploading images to imgur.
  • mashablekey - Sets the mashable oauth key.

Special Thanks

Bruce Marriner - For DiscordGo and the Music Plugin.