witer33
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
23 additions and
0 deletions
-
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() |
|
|
|
} |
|
|
|
``` |