Skip to content
/ crbot Public
forked from jakevoytko/crbot

A Discord bot that acts as a call-and-response bot. It reacts to ? commands with the learned response.

License

Notifications You must be signed in to change notification settings

drvan/crbot

 
 

Repository files navigation

CRBot

CRBot is a Discord bot that you can teach to respond to user-defined commands. CRBot is short for "Call and Response Bot". Commands are taught using ?learn <call> <response>, and can retrieve the response with ?call.

It works really well for media retrieval; the Discord unfurler will inline images, videos, etc.

This was initially a weekend project to see if my friends would like it. Now that they haven't banned the bot (or me), I'm in the process of turning this into something that's maintainable.

Example

Jake: ?help
crbot: Type ?help for this message, ?list to list all commands, or
       ?help <command> to get help for a particular command.

Jake: ?learn bearshrug ʅʕ•ᴥ•ʔʃ
crbot: Learned about bearshrug

One of my friends: What's the weather tomorrow?
Jake: ?bearshrug
crbot: ʅʕ•ᴥ•ʔʃ

Prerequisites

  • Redis instance, standard port, no password, DB 0
  • go get github.com/bwmarrin/discordgo
  • go get gopkg.in/redis.v5
  • Add secret.json with single key, bot_token

Running

go run *.go

You have to run this with a bot account. You can register a bot account for free at the Discord site. Take the bot ID that you are given, and visit https://discordapp.com/oauth2/authorize?&client_id={$bot_id} in your browser, where {$bot_id} is replaced with the bot ID that you are given from the Discord developers site.

Before sending PR

Run through test doc. Tests coming soon!

More reading

Blog post: Writing a Discord bot, and techniques for writing effective small programs

About

A Discord bot that acts as a call-and-response bot. It reacts to ? commands with the learned response.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%