From 72633871249e16ebcf4fb087ad5de9914c8f3332 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Nov 2019 23:36:41 -0500 Subject: [PATCH] Add AdvertiseCommand example to docs --- docs_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs_test.go diff --git a/docs_test.go b/docs_test.go new file mode 100644 index 0000000..77808ec --- /dev/null +++ b/docs_test.go @@ -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) +}