Skip to content

costeirs/stephenbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stephenbot

Automated Nonsense

The Bot

Extends discord.js.

Running Locally

Fill in .env file and npm start

Contributing

Run npm run test to make sure tests pass.

Run npm run lint before committing.

Modules

modules/{name}/index.js: entry point for your module.

async/await is optional but recommended for methods with database operations.

module.exports = class Ping {
  /**
  * Define instance variables in the constructor
  */
  constructor () {
    this._anInstanceVariable = "example"
  }

  /**
  * Regex to match incoming messages against.
  * The user's message, minus the bot's name, will be tested against the regex.
  */
  get WatchPhrase () {
    return /^ping$/
  }

  /**
  * Fires every 10 seconds
  */
  async tick () {
    // ...
  }

  /**
  * Fires when the WatchPhrase is heard
  */
  async fire (message) {
    message.reply('pong')
  }
}

About

Automated Nonsense

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published