Skip to content

cadhead/Simple-Cytube-Commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-Cytube-Commands

Custom commands handler for Cytube.

Installation

CDN install (via jsdelivr)

$.getScript("https://cdn.jsdelivr.net/gh/cadhead/Simple-Cytube-Commands@master/dist/scc.min.js",
  function() {
    window.MyCustomCommands = new SimpleCytubeCommands({ socket: socket })
  })

Self build

for build minified version (using parcel)

git clone https://github.com/cadhead/Simple-Cytube-Commands.git
npm run build

Basic Usage Example

Configuraion

$.getScript("https://cdn.jsdelivr.net/gh/cadhead/Simple-Cytube-Commands@master/dist/scc.min.js",
  function() {
    window.MyCustomCommands = new SimpleCytubeCommands({ 
      socket: socket,
      filterPrefix: "!"
    })
  })

Add commands

window.MyCustomCommands /* we declare this previously (see configuration) */
  .commandRegister({
    text: "help",
    description: "Just another custom command.",
    handler: (params, data) => {
      // params it's all words after "!help"
      // e.g. !help my cool params = !help params[0] params[1] params[2]
      
      // data contains information about user and message
      // { username, msg, meta, timestamp }
    }
  })

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

About

Custom commands for @calzoneman/sync

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published