From c2d7fd3c2acdb2eacc72b1718cf1a8a49cc82373 Mon Sep 17 00:00:00 2001 From: witer33 Date: Mon, 3 Jan 2022 18:29:59 +0100 Subject: [PATCH] Update README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index cf08903..6c28a47 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ # twitchbot Go Twitch Bot Api wrapper, with an easy to use interface. + +# Example +```go +package main + +import ( + "twitch/twitchbot" +) + +func main() { + + bot := twitchbot.NewBot("oauth:abcdef", "mybot", []string{"channel"}) + + bot.OnMessage(func(bot *twitchbot.Bot, message *twitchbot.Message) { + if message.Message == "!ping" { + message.Reply("pong") + message.Delete() + } + }) + + bot.Run() +} +```