Giter Site home page Giter Site logo

plugins's Introduction

Circle CI

Active

  • gif: Posts a random gif url from [giphy.com][giphy.com]. Try it with: !gif cat
  • catgif: Posts a random cat gif url from [thecatapi.com][thecatapi.com]
  • godoc: Searches packages in godoc.org. Try it with: !godoc net/http
  • puppet: Allows you to send messages through the bot: Try it with: !puppet say #go-bot Hello!
  • guid: Generates a new guid
  • crypto: Encrypts the input data using sha1 or md5
  • encode: Encodes a string, currently only to base64
  • decode: Decodes a string. currently ony from base64
  • treta: Use it to sow discord on a channel

Tip: Use !help <command> to obtaing more info about these commands.

Passive (triggers)

Passive commands receive all the text sent to the bot or the channels that the bot is in and can process it and reply.

These commands differ from the active commands as they are executed for every text that the bot receives. Ex: The Chuck Norris command, replies with a Chuck Norris fact every time the words "chuck" or "norris" are mentioned on a channel.

  • url: Detects url and gets it's title (very naive implementation, works sometimes)
  • catfacts: Tells a random cat fact based on some cat keywords
  • jira: Detects jira issue numbers and posts the url (necessary to configure the JIRA URL)
  • chucknorris: Shows a random chuck norris quote every time the word "chuck" is mentioned

Periodic (triggers)

Periodic commands are run based on a cron specification passed to the config. These commands are runned periodically, outputting a message to the configured channel(s).

Look into the good morning example command for guidance on how to write and configure periodic commands.

Wish to write a new plugin?

Start with the example commands in the example directory.

It's dead simple, you just need to write a go function and register it on the bot.

Here's a Hello World plugin example:

package example

import (
	"fmt"

	"github.com/go-chat-bot/bot"
)

func hello(command *bot.Cmd) (msg string, err error) {
	msg = fmt.Sprintf("Hello %s", command.User.RealName)
	return
}

func init() {
	bot.RegisterCommand(
		"hello",
		"Sends a 'Hello' message to you on the channel.",
		"",
		hello)
}

plugins's People

Contributors

fabioxgn avatar martinusso avatar mbombonato avatar robertoschneiders avatar aspic avatar dukex avatar nloadholtes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.