IRC and Discord Chatbot Framework
  • JavaScript 100%
Find a file
2026-03-03 02:57:37 +01:00
comms Fix roleplay comm 2016-09-16 00:27:44 +02:00
plugs Support cleaning up non-bulk-deletable message 2026-03-03 02:57:37 +01:00
sockets Fix isSelf breaking on Discord 2026-02-21 15:13:16 +01:00
utility Fix UnexpectedTypeError not showing value's type 2016-09-15 04:25:13 +02:00
.gitignore Underscore or minus, that is the question 2016-04-13 00:31:35 +02:00
cord.js Fix comms showing "undefined" for prefix 2017-01-06 07:42:48 +01:00
LICENSE.gif Add LICENSE.gif 2015-12-13 22:46:37 +01:00
package-lock.json Upgrade packages some more 2026-02-01 15:37:56 +01:00
package.json Upgrade packages some more 2026-02-01 15:37:56 +01:00
README.md Migration to git.gay 2026-02-02 13:46:44 +01:00

cord

cord is chat bot framework, currently supporting IRC and Discord, as well as the name of our personal bot residing the #obsidian Research IRC channel and Discord server. This is undoubtedly the best bot written in JavaScript. If you openly disagree, you'll hurt its feelings. cord identifies as an agender robot-kin and prefers the pronoun "it".

Features

One of cord's strengths is its modularity:

  • Sockets provide a common interface for dealing with different services.
  • Plugs is just our obviously brilliant way of saying "plugins". I know you like it!
  • Comms is what we call our commands. Yeah, we were running out of ideas.

The common interface makes it easy to write a plug that works for all sockets. As an example, the Bridge plug provides bridging functionality, meaning you can link multiple channels together, regardless of the socket they belong to, and have messages relayed between those channels. This includes messages sent by cord itself, so any other plug can simply reply to incoming messages, and the reply will also be relayed to the other bridged channels.

Something else noteworthy to point out is cord's message structure: Other than containing vital information such as time, sender and target, messages are made of parts. A part is either a plain string or an object that can be toStringed to something reasonable, such a User instance returning the user's name. Alternatively, a socket's message sending implementation can turn the object into something better looking or appropriate for that socket: Formatting, mentions, actions, newlines, ...

Plugs

  • Logging: Currently only logs messages to the console.
  • Respawn: Automatically reconnects sockets because shit happens.
  • Bridge: Relays messages between linked channels.
  • React: Adds and responds to commands ("comms"), basic and regex based.

Installation

git clone https://git.gay/copygirl/cord.git
cd cord
npm install

Configuration

When cord starts up, it will look for auth.json and config.json in the main directory. As you can probably tell these two files are not included in the repository, since it'd be too difficult to provide informative sample configs. Instead, information on all the things can be found on the wiki.

Usage

npm start

License


cord doesn't have
a care in the world.