Browse Source

update configs

better example configs
- Used the bot to generate the example configs so they are correct.

adds filter configs to the example
main
Michael Parker 1 year ago
parent
commit
c86aa1d86c
  1. 2
      config.go
  2. 28
      config_examples.go
  3. 27
      configs/discord/example-bot/example-server/example-server.yml

2
config.go

@ -432,7 +432,7 @@ func createIfDoesntExist(name string) (err error) {
if fileCheck, err := os.OpenFile(name, os.O_RDONLY|os.O_CREATE, 0644); err != nil {
} else {
if err := fileCheck.Close(); err != nil {
return
return err
}
}
}

28
config_examples.go

@ -132,21 +132,33 @@ func createExampleDiscordConfig(confDir, verbose string) (err error) {
Commands: []command{
command{
Command: "example",
Reaction: []string{""},
Response: []string{"This is the response to the &prefix&example command"},
},
},
Keywords: []keyword{
keyword{
Keyword: "example",
Reaction: []string{},
Reaction: []string{""},
Response: []string{"I have responded to seeing the word example."},
},
},
Parsing: parsing{
Image: parsingImageConfig{
FileTypes: []string{},
Sites: []parsingConfig{},
FileTypes: []string{
"png",
"jpg"},
Sites: []parsingConfig{
{
Name: "pastebin",
URL: "'https://pastebin.com/'",
Format: "'https://pastebin.com/raw/&filename&'",
},
{
Name: "hastebin",
URL: "'https://hastebin.com/'",
Format: "'https://hastebin.com/raw/&filename&'",
},
},
},
Paste: parsingPasteConfig{
Sites: []parsingConfig{},
@ -163,6 +175,14 @@ func createExampleDiscordConfig(confDir, verbose string) (err error) {
Blacklisted: false,
},
},
Filters: []filter{
{
Term: "a bad word",
Reason: []string{
"the message was removed because it had 'a bad word' in it",
},
},
},
}
Log.Debugf("writing example server config to file %s", confDir+"example-bot/example-server/example.yml")

27
configs/discord/example-bot/example-server/example-server.yml

@ -23,26 +23,27 @@ channel_groups:
- command: example
response:
- This is the response to the &prefix&example command
reaction:
- ""
keywords:
- keyword: example
reaction:
- ""
response:
- I have responded to seeing the word example.
parsing:
image:
filetypes:
- png
- jpg
paste:
- png
- jpg
sites:
- name: pastebin
url: "https://pastebin.com/"
format: "https://pastebin.com/raw/&filename&"
- name: hastebin
url: "https://hastebin.com/"
format: "https://hastebin.com/raw/&filename&"
- name: pastebin
url: 'https://pastebin.com/'
format: 'https://pastebin.com/raw/&filename&'
- name: hastebin
url: 'https://hastebin.com/'
format: 'https://hastebin.com/raw/&filename&'
permissions:
- group: admin
filters:
- term: a bad word
reason:
- the message was removed because it had 'a bad word' in it
Loading…
Cancel
Save