Add AdvertiseCommand example to docs

This commit is contained in:
Sam
2019-11-03 23:36:41 -05:00
parent bab44f8b9e
commit 7263387124

20
docs_test.go Normal file
View File

@ -0,0 +1,20 @@
package keybase
func ExampleKeybase_AdvertiseCommand() {
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"),
NewBotCommand("hello", "Say hello"),
},
}
// Send advertisement
k.AdvertiseCommand(c)
}