gofmt all the things
This commit is contained in:
parent
6e7229d787
commit
4566ffc230
|
@ -4,6 +4,7 @@ Updates are listed in reverse chronological order.
|
||||||
### 1.4 (dev)
|
### 1.4 (dev)
|
||||||
- a copy of each deleted message is now send via DM to the author (suggested by CommanderLook)
|
- a copy of each deleted message is now send via DM to the author (suggested by CommanderLook)
|
||||||
- seasonal fluff
|
- seasonal fluff
|
||||||
|
- finally use gofmt
|
||||||
|
|
||||||
### 1.3
|
### 1.3
|
||||||
- use global array of pointers to commands to allow easier modification and avoid unnecessary memcpy
|
- use global array of pointers to commands to allow easier modification and avoid unnecessary memcpy
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
"github.com/deckarep/golang-set"
|
"github.com/deckarep/golang-set"
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
"log"
|
"log"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CommandType int
|
type CommandType int
|
||||||
|
@ -45,7 +45,6 @@ type Command struct {
|
||||||
UsersOnCooldown mapset.Set // don’t set this manually (it’s overwritten anyway)
|
UsersOnCooldown mapset.Set // don’t set this manually (it’s overwritten anyway)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Performs basic input validation on a given command and adds it to the global command array
|
// Performs basic input validation on a given command and adds it to the global command array
|
||||||
func registerCommand(command Command) {
|
func registerCommand(command Command) {
|
||||||
if command.Trigger == "" {
|
if command.Trigger == "" {
|
||||||
|
@ -254,4 +253,3 @@ func getHelpEmbed() *discordgo.MessageEmbed {
|
||||||
}
|
}
|
||||||
return embed
|
return embed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Embed struct {
|
type Embed struct {
|
||||||
|
@ -29,7 +29,6 @@ type Config struct {
|
||||||
RoleCommands map[string]string
|
RoleCommands map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func readConfig() Config {
|
func readConfig() Config {
|
||||||
file, _ := os.Open("config.json")
|
file, _ := os.Open("config.json")
|
||||||
conf := Config{}
|
conf := Config{}
|
||||||
|
@ -37,4 +36,3 @@ func readConfig() Config {
|
||||||
file.Close()
|
file.Close()
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,4 +52,3 @@ func onDM(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
"log"
|
"log"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func unlockUser(s *discordgo.Session, id string) {
|
func unlockUser(s *discordgo.Session, id string) {
|
||||||
|
|
12
main.go
12
main.go
|
@ -2,11 +2,11 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os/signal"
|
|
||||||
"os"
|
|
||||||
"syscall"
|
|
||||||
"log"
|
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
var config = readConfig()
|
var config = readConfig()
|
||||||
|
@ -68,8 +68,7 @@ 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: "!heil", Output: "(ノ・ェ・)ノ Selphy (ノ・ェ・)ノ", Type: CommandTypeFullMatch, Cooldown: 30})
|
registerCommand(Command{Trigger: "!heil", Output: "(ノ・ェ・)ノ Selphy (ノ・ェ・)ノ", Type: CommandTypeFullMatch, Cooldown: 30})
|
||||||
registerCommand(Command{Trigger: "ayy", Output: "lmao", Type: CommandTypeFullMatch, Cooldown: 0})
|
registerCommand(Command{Trigger: "ayy", Output: "lmao", Type: CommandTypeFullMatch, Cooldown: 0})
|
||||||
registerCommand(Command{Trigger: "<:selphyPadoru:525766188240732180>", Output: "<:selphypadoru:526644596558659594> Padoru <:selphypadoru:526644596558659594> Padoru <:selphypadoru:526644596558659594> Pado Padoru <:selphypadoru:526644596558659594>", Type: CommandTypeFullMatch, Cooldown: 10800})
|
registerCommand(Command{Trigger: "<:selphyDango:531594585424527370>", Output: "<:dango:430669469799677953> :notes: Dango Daikazoku :notes: <:dango:430669469799677953>", Type: CommandTypeFullMatch, Cooldown: 10800})
|
||||||
registerCommand(Command{Trigger: "<:selphyDango:507979223244341267>", Output: "<:dango:430669469799677953> :notes: Dango Daikazoku :notes: <:dango:430669469799677953>", Type: CommandTypeFullMatch, Cooldown: 10800})
|
|
||||||
registerCommand(Command{Trigger: "praise the sun", Output: "If only I could be so grossly incandescent \\\\[T]/", Type: CommandTypeContains, IgnoreCase: true, Cooldown: 85600})
|
registerCommand(Command{Trigger: "praise the sun", Output: "If only I could be so grossly incandescent \\\\[T]/", Type: CommandTypeContains, IgnoreCase: true, Cooldown: 85600})
|
||||||
|
|
||||||
// Information
|
// Information
|
||||||
|
@ -86,4 +85,3 @@ func addCommands() {
|
||||||
fmt.Printf("Successfully initialized %d commands\n", len(commands))
|
fmt.Printf("Successfully initialized %d commands\n", len(commands))
|
||||||
log.Printf("Successfully initialized %d commands", len(commands))
|
log.Printf("Successfully initialized %d commands", len(commands))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/bwmarrin/discordgo"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/bwmarrin/discordgo"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getWelcomeEmbed() *discordgo.MessageEmbed {
|
func getWelcomeEmbed() *discordgo.MessageEmbed {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user