use '.' instatt '!' as bot bash
This commit is contained in:
parent
2d8949dc69
commit
dcd0bd0e8f
27
README.md
27
README.md
|
@ -4,3 +4,30 @@
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/genofire/logmania/badge.svg?branch=master)](https://coveralls.io/github/genofire/logmania?branch=master)
|
[![Coverage Status](https://coveralls.io/repos/github/genofire/logmania/badge.svg?branch=master)](https://coveralls.io/github/genofire/logmania?branch=master)
|
||||||
[![Go Report Card](https://goreportcard.com/badge/dev.sum7.eu/genofire/logmania)](https://goreportcard.com/report/dev.sum7.eu/genofire/logmania)
|
[![Go Report Card](https://goreportcard.com/badge/dev.sum7.eu/genofire/logmania)](https://goreportcard.com/report/dev.sum7.eu/genofire/logmania)
|
||||||
[![GoDoc](https://godoc.org/dev.sum7.eu/genofire/logmania?status.svg)](https://godoc.org/dev.sum7.eu/genofire/logmania)
|
[![GoDoc](https://godoc.org/dev.sum7.eu/genofire/logmania?status.svg)](https://godoc.org/dev.sum7.eu/genofire/logmania)
|
||||||
|
|
||||||
|
|
||||||
|
This is a little logging server.
|
||||||
|
|
||||||
|
## input
|
||||||
|
It receive logs (events) by:
|
||||||
|
- syslog
|
||||||
|
- journald (with service nc)
|
||||||
|
- logrus (WIP)
|
||||||
|
- webhook
|
||||||
|
- git (github,gogs, gitea)
|
||||||
|
- circleci
|
||||||
|
- grafana
|
||||||
|
|
||||||
|
## output
|
||||||
|
And forward this logs (events) to multiple different output:
|
||||||
|
- xmpp (client and muc)
|
||||||
|
- file
|
||||||
|
- websocket (WIP)
|
||||||
|
|
||||||
|
there a multi filter possible
|
||||||
|
- regex
|
||||||
|
- priority
|
||||||
|
|
||||||
|
it could replace text by regex expression
|
||||||
|
|
||||||
|
configuration live possible by bot (on input e.g. xmpp)
|
||||||
|
|
|
@ -13,7 +13,7 @@ type commandFunc func(func(string), string, []string)
|
||||||
func (b *Bot) help(answer func(string), from string, params []string) {
|
func (b *Bot) help(answer func(string), from string, params []string) {
|
||||||
msg := fmt.Sprintf("Hi %s there are the following commands:\n", from)
|
msg := fmt.Sprintf("Hi %s there are the following commands:\n", from)
|
||||||
for _, cmd := range b.commands {
|
for _, cmd := range b.commands {
|
||||||
msg = fmt.Sprintf("%s - !%s\n", msg, cmd)
|
msg = fmt.Sprintf("%s - .%s\n", msg, cmd)
|
||||||
}
|
}
|
||||||
answer(msg)
|
answer(msg)
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ func NewBot(db *database.DB) *Bot {
|
||||||
|
|
||||||
func (b *Bot) Handle(answer func(string), from, msg string) {
|
func (b *Bot) Handle(answer func(string), from, msg string) {
|
||||||
msgParts := strings.Split(msg, " ")
|
msgParts := strings.Split(msg, " ")
|
||||||
if len(msgParts[0]) <= 0 || msgParts[0][0] != '!' {
|
if len(msgParts[0]) <= 0 || msgParts[0][0] != '.' {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cmdName := msgParts[0][1:]
|
cmdName := msgParts[0][1:]
|
||||||
|
|
Loading…
Reference in New Issue