Giter VIP home page Giter VIP logo

hanu's Issues

Limited number of words in a message

I want to do same thing in every message. If it is 1 word, 2 words, 3 words. I use the functions
slack.Command("word",func(conv hanu.ConversationInterface),
slack.Command("word" "word2", func(conv hanu.ConversationInterface)
slack.Command("word" "word2" "word3", func(conv hanu.ConversationInterface) respectivelty.

It continues for every number of words in a message. What is the shortest way of do this?
Thanks
Edit: the words are in the < >

Handle unknown commands

Hi,

Thanks for your great work.

I'm asking for a way to handle unknown commands.
My bot is handling 2 commands as the following.

slack.Command("shout <word>", func(conv hanu.ConversationInterface) {
	str, _ := conv.String("word")
	fmt.Println(conv.Message().Text())
	conv.Reply(strings.ToUpper(str))
})

slack.Command("your version", func(conv hanu.ConversationInterface) {
	conv.Reply("Thanks for asking! I'm running `%s`", "323")
})

I want the bot to reply a message such as I don't understand your command when someone tries to send it an undefined command. Is it possible? Something like:

slack.UnknownCommand(func(conv hanu.ConversationInterface) {
	conv.Reply("Thanks for asking! But I don't understand your command.")
})

Formatting response

Is it possible to use conv.Reply to send more elaborately formatted messages, or is plain text the only option?

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.