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