• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Civil / tg-simple-regex-antispam / 13070263183

31 Jan 2025 09:45AM UTC coverage: 0.0%. Remained the same
13070263183

Pull #5

github

Civil
Refactor and improve bot

 * Fixed small bug in forward action
 * package statefulFilters renamed to chains
 * generic badgerdb interface
 * add filter that counts repeated messages
 * add filter that checks if message is a story
 * add filter that checks if message was marked as spam
Pull Request #5: some improvements

0 of 1422 new or added lines in 20 files covered. (0.0%)

21 existing lines in 3 files now uncovered.

0 of 3756 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/actions/supported.go
1
package actions
2

3
import (
4
        "errors"
5

6
        "github.com/Civil/tg-simple-regex-antispam/actions/addReportButton"
7
        "github.com/Civil/tg-simple-regex-antispam/actions/deleteAndBan"
8
        "github.com/Civil/tg-simple-regex-antispam/actions/forwardToChat"
9
        "github.com/Civil/tg-simple-regex-antispam/actions/interfaces"
10
        "github.com/Civil/tg-simple-regex-antispam/actions/storeAsSpam"
11
)
12

13
var (
14
        supportedActions = map[string]interfaces.InitFunc{
15
                "deleteAndBan":    deleteAndBan.New,
16
                "addReportButton": addReportButton.New,
17
                "forwardToChat":   forwardToChat.New,
18
                "storeAsSpam":     storeAsSpam.New,
19
        }
20
        supportedActionsHelp = map[string]interfaces.HelpFunc{
21
                "deleteAndBan":    deleteAndBan.Help,
22
                "addReportButton": addReportButton.Help,
23
                "forwardToChat":   forwardToChat.Help,
24
                "storeAsSpam":     storeAsSpam.Help,
25
        }
26
)
27

28
var ErrUnknownAction = errors.New("unknown action")
29

30
func GetAction(name string) (interfaces.InitFunc, error) {
×
31
        action, ok := supportedActions[name]
×
32
        if !ok {
×
NEW
33
                return nil, ErrUnknownAction
×
34
        }
×
35
        return action, nil
×
36
}
37

38
func GetActions() map[string]interfaces.InitFunc {
×
39
        return supportedActions
×
40
}
×
41

42
func GetHelp() map[string]interfaces.HelpFunc {
×
43
        return supportedActionsHelp
×
44
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc