Add AdvertiseCommand example to docs
This commit is contained in:
20
docs_test.go
Normal file
20
docs_test.go
Normal 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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user