Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ras0q/traq-chat
Make creating traQ chat-bot easier.
https://github.com/ras0q/traq-chat
bot traq
Last synced: 3 months ago
JSON representation
Make creating traQ chat-bot easier.
- Host: GitHub
- URL: https://github.com/ras0q/traq-chat
- Owner: ras0q
- License: mit
- Created: 2021-09-18T17:17:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-30T02:53:38.000Z (5 months ago)
- Last Synced: 2024-07-09T10:04:44.238Z (4 months ago)
- Topics: bot, traq
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traq-chat
Make creating traQBot easier.
## Example
```go
package mainimport (
"fmt"
"os"
"regexp"traqchat "github.com/ras0q/traq-chat"
)func main() {
q := traqchat.New(
os.Getenv("BOT_ID"),
os.Getenv("BOT_USER_ID"),
os.Getenv("BOT_ACCESS_TOKEN"),
os.Getenv("BOT_VERIFICATION_TOKEN"),
)q.Hear(regexp.MustCompile(`ping`), func(res *traqchat.Response) error {
res.Send("pong!")return nil
})q.Respond(regexp.MustCompile(`Hello`), hello)
q.Start(80)
}func hello(res *traqchat.Response) error {
res.Reply(fmt.Sprintf("Hello, %s\n", res.Message.User.DisplayName))return nil
}
```## More Information for traQ Bot
- [traPtitech/traq-bot: traQ BOT用Goライブラリ](https://github.com/traPtitech/traq-bot)