https://github.com/mavolin/humano
Humano is a message replier for adam that immitates human typing by adding delays in between messages.
https://github.com/mavolin/humano
Last synced: 2 months ago
JSON representation
Humano is a message replier for adam that immitates human typing by adding delays in between messages.
- Host: GitHub
- URL: https://github.com/mavolin/humano
- Owner: mavolin
- License: mit
- Created: 2021-02-21T12:32:38.000Z (about 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-02-21T16:30:54.000Z (about 4 years ago)
- Last Synced: 2025-01-10T02:47:57.672Z (4 months ago)
- Language: Go
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
humano
[](https://pkg.go.dev/github.com/mavolin/humano)
[](https://github.com/mavolin/humano/actions)
[](https://goreportcard.com/report/github.com/mavolin/humano)
[](https://github.com/mavolin/humano/blob/develop/LICENSE)---
## About
Humano is a small utility for [adam](https://github.com/mavolin/adam), that allows you to imitate typing, by delaying messages.
## Example
```go
package mainimport (
"log"
"os"
"os/signal""github.com/mavolin/adam/pkg/bot"
"github.com/mavolin/humano/pkg/replier"
)func main() {
b, err := bot.New(bot.Options{
Token: os.Getenv("DISCORD_BOT_TOKEN"),
})
if err != nil {
log.Fatal(err)
}b.MustAddMiddleware(replier.NewMiddleware(&replier.Options{}))
// add commands
if err := b.Open(); err != nil {
log.Fatal(err)
}sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt)<-sig
if err := b.Close(); err != nil {
log.Fatal(err)
}
}
``````go
package mycommand...
func (c *MyCommand) Invoke(s *state.State, ctx *plugin.Context) (interface{}, error) {
_, err := replier.Reply(ctx, "Wumpus!")
return nil, err
}
```