I can’t into json :selphyDerp: (actually fix #2)
This commit is contained in:
parent
f5454910d0
commit
35db30626d
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"Token": "your login token",
|
"Token": "your login token",
|
||||||
"Admins": {
|
"Admins": [
|
||||||
"your user ID",
|
"your user ID",
|
||||||
"another admin ID"
|
"another admin ID"
|
||||||
},
|
],
|
||||||
"ServerID": "the server the bot will be running on",
|
"ServerID": "the server the bot will be running on",
|
||||||
"RequireAccept": false,
|
"RequireAccept": false,
|
||||||
"LockedRoleID": "the role to be given to locked users (readme)",
|
"LockedRoleID": "the role to be given to locked users (readme)",
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
"QuestionsTitle": "__Questions__",
|
"QuestionsTitle": "__Questions__",
|
||||||
"QuestionsText": "pls ask the mods. kthxbye",
|
"QuestionsText": "pls ask the mods. kthxbye",
|
||||||
"BugsTitle": "__Bugs__",
|
"BugsTitle": "__Bugs__",
|
||||||
"BugsText": "please ask <@%s>. (this will be formatted with the AdminID above",
|
"BugsText": "please ask <@%s>. (this will be formatted with Admins[0] above",
|
||||||
"Image": "https://static-cdn.jtvnw.net/emoticons/v1/970966/3.0"
|
"Image": "https://static-cdn.jtvnw.net/emoticons/v1/970966/3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
main.go
32
main.go
|
@ -18,29 +18,32 @@ func main() {
|
||||||
fmt.Println("error: ", err)
|
fmt.Println("error: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
dg.AddHandler(evaluateMessage)
|
dg.AddHandler(evaluateMessage)
|
||||||
dg.AddHandler(onJoin)
|
dg.AddHandler(onJoin)
|
||||||
err = dg.Open()
|
err = dg.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("no connection, ", err)
|
fmt.Println("No connection:\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
f, err := os.OpenFile("selphybot.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
|
f, err := os.OpenFile("selphybot.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("error opening log file: %v", err)
|
fmt.Println("Error opening log file:\n", err)
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
log.SetOutput(f)
|
log.SetOutput(f)
|
||||||
|
|
||||||
addCommands()
|
addCommands()
|
||||||
|
|
||||||
fmt.Println("bot running. selphyWoo")
|
fmt.Println("Bot running. selphyWoo")
|
||||||
|
log.Println("Bot running. selphyWoo")
|
||||||
sc := make(chan os.Signal, 1)
|
sc := make(chan os.Signal, 1)
|
||||||
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
|
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
|
||||||
<-sc
|
<-sc
|
||||||
|
|
||||||
|
fmt.Println("Exiting...")
|
||||||
|
log.Println("Exiting...")
|
||||||
|
|
||||||
dg.Close()
|
dg.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,23 +62,18 @@ func addCommands() {
|
||||||
registerCommand(Command{Trigger: "o/", Output: "\\o", Type: CommandTypeFullMatch, Cooldown: 10})
|
registerCommand(Command{Trigger: "o/", Output: "\\o", Type: CommandTypeFullMatch, Cooldown: 10})
|
||||||
registerCommand(Command{Trigger: "\\o", Output: "o/", Type: CommandTypeFullMatch, Cooldown: 10})
|
registerCommand(Command{Trigger: "\\o", Output: "o/", Type: CommandTypeFullMatch, Cooldown: 10})
|
||||||
registerCommand(Command{Trigger: "\\o/", Output: "/o\\", Type: CommandTypeFullMatch, Cooldown: 10})
|
registerCommand(Command{Trigger: "\\o/", Output: "/o\\", Type: CommandTypeFullMatch, Cooldown: 10})
|
||||||
registerCommand(Command{Trigger: "<:selphyDango:441001954542616576>", Output: ":notes: Dango, Dango, Dango, Dango, Dango Daikazoku :notes:", Type: CommandTypeFullMatch, Cooldown: 1200})
|
registerCommand(Command{Trigger: "<:selphyDango:441001954542616576>", Output: ":notes: Dango, Dango, Dango, Dango, Dango Daikazoku :notes:", Type: CommandTypeFullMatch, Cooldown: 85600})
|
||||||
registerCommand(Command{Trigger: "praise the sun", Output: "If only I could be so grossly incandescent \\\\[T]/", Type: CommandTypeContains, IgnoreCase: true, Cooldown: 30})
|
registerCommand(Command{Trigger: "praise the sun", Output: "If only I could be so grossly incandescent \\\\[T]/", Type: CommandTypeContains, IgnoreCase: true, Cooldown: 85600})
|
||||||
|
|
||||||
// Information
|
// Information
|
||||||
registerCommand(Command{Trigger: "!welcome", OutputEmbed: getWelcomeEmbed(), Type: CommandTypeFullMatch, DMOnly: true})
|
registerCommand(Command{Trigger: "!welcome", OutputEmbed: getWelcomeEmbed(), Type: CommandTypeFullMatch, DMOnly: true})
|
||||||
|
|
||||||
// Admin
|
// Admin and/or debug
|
||||||
registerCommand(Command{Trigger: "<@%s> <3", Output: "<@%s> <3", Type: CommandTypeFullMatch, AdminOnly: true, OutputIsReply: true, RequiresMention: true})
|
registerCommand(Command{Trigger: "<@%s> <3", Output: "<@%s> <3", Type: CommandTypeFullMatch, AdminOnly: true, OutputIsReply: true, RequiresMention: true})
|
||||||
|
registerCommand(Command{Trigger: "echo", Type: CommandTypePrefix, Function: echoMessage, AdminOnly: true})
|
||||||
|
|
||||||
// Debug
|
fmt.Printf("Successfully initialized %d commands\n", len(commands))
|
||||||
// registerCommand(Command{Trigger: "echo", Type: CommandTypePrefix, Function: echoMessage})
|
log.Printf("Successfully initialized %d commands", len(commands))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*func undelete(s *discordgo.Session, m *discordgo.MessageDelete) {
|
|
||||||
channel, _ := s.State.Channel(m.ChannelID)
|
|
||||||
message, _ := s.State.Message(m.ChannelID, m.ID)
|
|
||||||
log.Println(fmt.Sprintf("Someone deleted a message in %s: “%s”", channel.Name, messageToString(message)))
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user