use '.' instatt '!' as bot bash

This commit is contained in:
Martin/Geno 2018-09-07 13:35:33 +02:00
parent 2d8949dc69
commit dcd0bd0e8f
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
3 changed files with 29 additions and 2 deletions

View File

@ -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)

View File

@ -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)
} }

View File

@ -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:]