From dcd0bd0e8fb2a1f36848797e7fe024ab19871489 Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Fri, 7 Sep 2018 13:35:33 +0200 Subject: [PATCH] use '.' instatt '!' as bot bash --- README.md | 27 +++++++++++++++++++++++++++ bot/command.go | 2 +- bot/main.go | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9464a9f..fea13db 100644 --- a/README.md +++ b/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) [![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) + + +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) diff --git a/bot/command.go b/bot/command.go index 6f74480..e2fc10f 100644 --- a/bot/command.go +++ b/bot/command.go @@ -13,7 +13,7 @@ type commandFunc func(func(string), string, []string) func (b *Bot) help(answer func(string), from string, params []string) { msg := fmt.Sprintf("Hi %s there are the following commands:\n", from) for _, cmd := range b.commands { - msg = fmt.Sprintf("%s - !%s\n", msg, cmd) + msg = fmt.Sprintf("%s - .%s\n", msg, cmd) } answer(msg) } diff --git a/bot/main.go b/bot/main.go index 9f9280a..47e162c 100644 --- a/bot/main.go +++ b/bot/main.go @@ -42,7 +42,7 @@ func NewBot(db *database.DB) *Bot { func (b *Bot) Handle(answer func(string), from, msg string) { msgParts := strings.Split(msg, " ") - if len(msgParts[0]) <= 0 || msgParts[0][0] != '!' { + if len(msgParts[0]) <= 0 || msgParts[0][0] != '.' { return } cmdName := msgParts[0][1:]