Sam
5 years ago
3 changed files with 88 additions and 35 deletions
@ -1,20 +1,35 @@
@@ -1,20 +1,35 @@
|
||||
package keybase |
||||
|
||||
func ExampleKeybase_AdvertiseCommand() { |
||||
import "samhofi.us/x/keybase/types/chat1" |
||||
|
||||
func ExampleKeybase_AdvertiseCommands() { |
||||
var k = NewKeybase() |
||||
|
||||
// Clear out any previously advertised commands
|
||||
k.ClearCommands() |
||||
|
||||
// Create BotAdvertisement
|
||||
c := BotAdvertisement{ |
||||
Type: "public", |
||||
BotCommands: []BotCommand{ |
||||
NewBotCommand("help", "Get help using this bot", "!help <command>"), |
||||
NewBotCommand("hello", "Say hello", "!hello"), |
||||
ads := AdvertiseCommandsOptions{ |
||||
Alias: "RSS Bot", |
||||
Advertisements: []chat1.AdvertiseCommandAPIParam{ |
||||
{ |
||||
Typ: "public", |
||||
Commands: []chat1.UserBotCommandInput{ |
||||
{ |
||||
Name: "rss addfeed", |
||||
Description: "Add RSS feed", |
||||
Usage: "<url>", |
||||
}, |
||||
{ |
||||
Name: "rss delfeed", |
||||
Description: "Remove RSS feed", |
||||
Usage: "<url>", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
} |
||||
|
||||
// Send advertisement
|
||||
k.AdvertiseCommand(c) |
||||
k.AdvertiseCommands(ads) |
||||
} |
||||
|
Loading…
Reference in new issue