forked from kageru/discord-selphybot
split project into multiple files
parent
0acb15b138
commit
93014d944b
@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type Embed struct {
|
||||
Message string
|
||||
QuestionsTitle string
|
||||
QuestionsText string
|
||||
BugsTitle string
|
||||
BugsText string
|
||||
Image string
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
AdminID string
|
||||
ServerID string
|
||||
LockedRoleID string
|
||||
Token string
|
||||
WelcomeChannel string
|
||||
GeneralChannel string
|
||||
SendWelcomeDM bool
|
||||
RequireAccept bool
|
||||
ComplaintReceivedMessage string
|
||||
ModChannel string
|
||||
WelcomeEmbed Embed
|
||||
RoleCommands map[string]string
|
||||
}
|
||||
|
||||
|
||||
func readConfig() Config {
|
||||
file, _ := os.Open("config.json")
|
||||
conf := Config{}
|
||||
json.NewDecoder(file).Decode(&conf)
|
||||
file.Close()
|
||||
return conf
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
type CommandType int
|
||||
|
||||
const (
|
||||
CommandTypePrefix CommandType = 0
|
||||
CommandTypeFullMatch CommandType = 1
|
||||
CommandTypeRegex CommandType = 2
|
||||
)
|
||||
|
||||
type Command struct {
|
||||
Input string
|
||||
Output string
|
||||
Type CommandType
|
||||
OutputIsReply bool
|
||||
DeleteInput bool
|
||||
DMOnly bool
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue