Skip to content

Commit

Permalink
refactor: new authorID column, renamed server table
Browse files Browse the repository at this point in the history
U happy tech?
  • Loading branch information
TheTipo01 committed Dec 26, 2021
1 parent 6c6ea14 commit 72675eb
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 49 deletions.
61 changes: 31 additions & 30 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import (
"github.com/bwmarrin/lit"
"github.com/go-co-op/gocron"
"github.com/goccy/go-json"
"strings"
"time"
)

const (
tblMessages = "CREATE TABLE IF NOT EXISTS `messages`( `guildID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `channelID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `messageID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `message` text CHARACTER SET utf8mb4 NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`messageID`) USING BTREE) DEFAULT CHARSET=utf8;"
tblMessages = "CREATE TABLE IF NOT EXISTS `messages`( `guildID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `channelID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `messageID` varchar(18) CHARACTER SET utf8mb4 NOT NULL, `authorID` varchar(18) DEFAULT NULL, `message` longtext CHARACTER SET utf8mb4 NOT NULL CHECK (json_valid(`message`)), `deleted` tinyint(1) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`messageID`) USING BTREE) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;"
tblUsers = "CREATE TABLE IF NOT EXISTS `users`( `id` varchar(18) NOT NULL, `nickname` varchar(32) NOT NULL, PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8mb4;"
tblServer = "CREATE TABLE IF NOT EXISTS `server`( `id` varchar(18) NOT NULL, `name` varchar(100) NOT NULL, PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8mb4;"
tblServers = "CREATE TABLE IF NOT EXISTS `servers`( `id` varchar(18) NOT NULL, `name` varchar(100) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
tblChannels = "CREATE TABLE IF NOT EXISTS `channels`( `id` varchar(18) NOT NULL, `name` text NOT NULL DEFAULT '', `serverId` varchar(18) NOT NULL, PRIMARY KEY (`id`), KEY `FK_channels_server` (`serverId`), CONSTRAINT `FK_channels_server` FOREIGN KEY (`serverId`) REFERENCES `server` (`id`)) DEFAULT CHARSET=utf8mb4;"
tblPings = "CREATE TABLE IF NOT EXISTS `pings`( `id` int(11) NOT NULL AUTO_INCREMENT, `menzionatoreId` varchar(18) NOT NULL, `menzionatoId` varchar(18) NOT NULL, `channelId` varchar(18) NOT NULL, `serverId` varchar(18) NOT NULL, `timestamp` datetime NOT NULL, `messageId` varchar(18) NOT NULL, PRIMARY KEY (`id`), KEY `FK_pings_channels` (`channelId`), KEY `FK_pings_server` (`serverId`), KEY `FK_pings_users` (`menzionatoreId`), KEY `FK_pings_users_2` (`menzionatoId`), KEY `messageId` (`messageId`), CONSTRAINT `FK_pings_channels` FOREIGN KEY (`channelId`) REFERENCES `channels` (`id`), CONSTRAINT `FK_pings_messages` FOREIGN KEY (`messageId`) REFERENCES `messages` (`messageID`), CONSTRAINT `FK_pings_server` FOREIGN KEY (`serverId`) REFERENCES `server` (`id`), CONSTRAINT `FK_pings_users` FOREIGN KEY (`menzionatoreId`) REFERENCES `users` (`id`), CONSTRAINT `FK_pings_users_2` FOREIGN KEY (`menzionatoId`) REFERENCES `users` (`id`)) DEFAULT CHARSET=utf8mb4;"
tblConfig = "CREATE TABLE IF NOT EXISTS `config`( `id` int(11) NOT NULL AUTO_INCREMENT, `guildID` varchar(18) CHARACTER SET utf8mb4 NOT NULL DEFAULT '0', `channelID` varchar(18) CHARACTER SET utf8mb4 NOT NULL DEFAULT '0', `channelToID` varchar(18) CHARACTER SET utf8mb4 NOT NULL DEFAULT '0', `offset` int(11) DEFAULT 0, PRIMARY KEY (`id`), KEY `FK_config_server` (`guildID`), KEY `FK_config_channels` (`channelID`), KEY `FK_config_channels_2` (`channelToID`), CONSTRAINT `FK_config_channels` FOREIGN KEY (`channelID`) REFERENCES `channels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `FK_config_channels_2` FOREIGN KEY (`channelToID`) REFERENCES `channels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `FK_config_server` FOREIGN KEY (`guildID`) REFERENCES `server` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;"
Expand All @@ -31,16 +30,24 @@ func execQuery(query ...string) {

// addMessage adds a message to the db
func addMessage(m *discordgo.Message) {
var err error
inJSON, _ := json.Marshal(m)
_, err := db.Exec("INSERT INTO messages (guildID, channelID, messageID, message) VALUES (?, ?, ?, ?)", m.GuildID, m.ChannelID, m.ID, string(inJSON))

if m.Author != nil {
insertAuthor(m)
_, err = db.Exec("INSERT INTO messages (guildID, channelID, messageID, authorID, message) VALUES (?, ?, ?, ?, ?)", m.GuildID, m.ChannelID, m.ID, m.Author.ID, inJSON)
} else {
_, err = db.Exec("INSERT INTO messages (guildID, channelID, messageID, message) VALUES (?, ?, ?, ?)", m.GuildID, m.ChannelID, m.ID, inJSON)
}

if err != nil {
lit.Error("Error while inserting message into db, %s", err)
}
}

func deleteMessage(s *discordgo.Session, m *discordgo.Message) {
// Set delete flag up
_, err := db.Exec("UPDATE messages SET deleted=1 WHERE guildID=? AND channelID=? AND messageID=?", m.GuildID, m.ChannelID, m.ID)
_, err := db.Exec("UPDATE messages SET deleted=1 WHERE messageID=?", m.ID)
if err != nil {
lit.Error("Error updating row from the database, %s", err)
}
Expand All @@ -51,7 +58,7 @@ func deleteMessage(s *discordgo.Session, m *discordgo.Message) {
oldMessage discordgo.Message
)

_ = db.QueryRow("SELECT message FROM messages WHERE guildID=? AND channelID=? AND messageID=?", m.GuildID, m.ChannelID, m.ID).Scan(&message)
_ = db.QueryRow("SELECT message FROM messages WHERE messageID=?", m.ID).Scan(&message)
_ = json.Unmarshal(message, &oldMessage)

if oldMessage.MentionEveryone {
Expand Down Expand Up @@ -84,13 +91,13 @@ func updateMessage(s *discordgo.Session, m *discordgo.Message) {
oldMessage discordgo.Message
)

_ = db.QueryRow("SELECT message FROM messages WHERE guildID=? AND channelID=? AND messageID=?", m.GuildID, m.ChannelID, m.ID).Scan(&message)
_ = db.QueryRow("SELECT message FROM messages WHERE messageID=?", m.ID).Scan(&message)
_ = json.Unmarshal(message, &oldMessage)

// Update existing message
jsonMessage, _ := json.Marshal(m)

_, err := db.Exec("UPDATE messages SET message=? WHERE guildID=? AND channelID=? AND messageID=?", string(jsonMessage), m.GuildID, m.ChannelID, m.ID)
_, err := db.Exec("UPDATE messages SET message=? WHERE messageID=?", jsonMessage, m.ID)
if err != nil {
lit.Error("Error updating row from the database, %s", err)
}
Expand Down Expand Up @@ -144,53 +151,47 @@ func insertData(s *discordgo.Session, message *discordgo.Message, mention *disco
// Guild
g, err := s.Guild(message.GuildID)
if err == nil {
_, err = db.Exec("INSERT INTO server (id, name) VALUES(?, ?)", g.ID, g.Name)
_, err = db.Exec("INSERT IGNORE INTO servers (id, name) VALUES(?, ?)", g.ID, g.Name)
if err != nil {
str = err.Error()
if !strings.HasPrefix(str, "Error 1062: Duplicate entry") {
lit.Error("Error inserting channel in the database, %s", str)
}
lit.Error("Error inserting channel in the database, %s", str)
}
} else {
lit.Error("cannot create guild, %s", err)
}

// Author insert
_, err = db.Exec("INSERT INTO users (id, nickname) VALUES(?, ?)", message.Author.ID, message.Author.Username)
if err != nil {
str = err.Error()
if !strings.HasPrefix(str, "Error 1062: Duplicate entry") {
lit.Error("Error inserting user in the database, %s", str)
}
}
insertAuthor(message)

// Mentioned
if mention != nil {
_, err = db.Exec("INSERT INTO users (id, nickname) VALUES(?, ?)", mention.ID, mention.Username)
_, err = db.Exec("INSERT IGNORE INTO users (id, nickname) VALUES(?, ?)", mention.ID, mention.Username)
if err != nil {
str = err.Error()
if !strings.HasPrefix(str, "Error 1062: Duplicate entry") {
lit.Error("Error inserting user in the database, %s", str)
}
lit.Error("Error inserting user in the database, %s", str)
}
}

// Channel
channel, err := s.Channel(message.ChannelID)
if err == nil {
_, err = db.Exec("INSERT INTO channels (id, name, serverId) VALUES(?, ?, ?)", channel.ID, channel.Name, channel.GuildID)
_, err = db.Exec("INSERT IGNORE INTO channels (id, name, serverId) VALUES(?, ?, ?)", channel.ID, channel.Name, channel.GuildID)
if err != nil {
str = err.Error()
if !strings.HasPrefix(str, "Error 1062: Duplicate entry") {
lit.Error("Error inserting channel in the database, %s", str)
}
lit.Error("Error inserting channel in the database, %s", str)
}
} else {
lit.Error("cannot create channel, %s", err)
}

}

func insertAuthor(message *discordgo.Message) {
if message.Author != nil {
_, err := db.Exec("INSERT IGNORE INTO users (id, nickname) VALUES(?, ?)", message.Author.ID, message.Author.Username)
if err != nil {
lit.Error("Error inserting user in the database, %s", err.Error())
}
}
}

// Every Monday at midnight sends a random message for configured guilds
func loadScheduler(s *discordgo.Session) {
// Create cron scheduler
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ module messageCounter
go 1.16

require (
github.com/bwmarrin/discordgo v0.23.3-0.20211117035633-fd6228c0d536
github.com/bwmarrin/discordgo v0.23.3-0.20211224173850-fccf6db03e62
github.com/bwmarrin/lit v0.0.0-20190813132558-fd4b44871312
github.com/go-co-op/gocron v1.9.1-0.20211112222031-5dd4543bebdf
github.com/go-co-op/gocron v1.11.0
github.com/go-sql-driver/mysql v1.6.0
github.com/goccy/go-json v0.7.10
github.com/goccy/go-json v0.8.1
github.com/kkyr/fig v0.3.0
github.com/kr/pretty v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/psykhi/wordclouds v0.0.0-20210822210240-4b9d0b119a32
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
github.com/bwmarrin/discordgo v0.23.3-0.20211117035633-fd6228c0d536 h1:KLvbHLidkxOGTmdiTmii0DOJ0BDSeOCUrXuvf/9CNr0=
github.com/bwmarrin/discordgo v0.23.3-0.20211117035633-fd6228c0d536/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
github.com/bwmarrin/discordgo v0.23.3-0.20211224173850-fccf6db03e62 h1:JwGYbquRDDriQ/pG1GzWA3QPexsZz2vXk7Bb5WDzuec=
github.com/bwmarrin/discordgo v0.23.3-0.20211224173850-fccf6db03e62/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
github.com/bwmarrin/lit v0.0.0-20190813132558-fd4b44871312 h1:g5NUBR8yN3F2RWN4vrkd8wVr7vyLxr0hbq4I6PAZQc0=
github.com/bwmarrin/lit v0.0.0-20190813132558-fd4b44871312/go.mod h1:z4cxqo0ARxc42jGHYZT4XoICeLf9OVOkysN7LuqBZ24=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-co-op/gocron v1.9.1-0.20211112222031-5dd4543bebdf h1:bSZekrIeXz0K602H+kLfs6tSik9LR6MjFuZuUcXlhtM=
github.com/go-co-op/gocron v1.9.1-0.20211112222031-5dd4543bebdf/go.mod h1:qtlsoMpHlSdIZ3E/xuZzrrAbeX3u5JtPvWf2TcdutU0=
github.com/go-co-op/gocron v1.11.0 h1:ujOMubCpGcTxnnR/9vJIPIEpgwuAjbueAYqJRNr+nHg=
github.com/go-co-op/gocron v1.11.0/go.mod h1:qtlsoMpHlSdIZ3E/xuZzrrAbeX3u5JtPvWf2TcdutU0=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goccy/go-json v0.7.10 h1:ulhbuNe1JqE68nMRXXTJRrUu0uhouf0VevLINxQq4Ec=
github.com/goccy/go-json v0.7.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.8.1 h1:4/Wjm0JIJaTDm8K1KcGrLHJoa8EsJ13YWeX+6Kfq6uI=
github.com/goccy/go-json v0.8.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
Expand All @@ -25,8 +25,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
Expand All @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
Expand All @@ -55,8 +55,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1 h1:kwrAHlwJ0DUBZwQ238v+Uod/3eZ8B2K5rYsUHBQvzmI=
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
}

// Initialize tables
execQuery(tblMessages, tblUsers, tblServer, tblChannels, tblPings, tblConfig)
execQuery(tblMessages, tblUsers, tblServers, tblChannels, tblPings, tblConfig)

// And add the everyone user to the table, as we use that for logging @everyone and @here
_, err = db.Exec("INSERT INTO users (id, nickname) VALUES(?, ?)", "everyone", "everyone")
Expand Down

0 comments on commit 72675eb

Please sign in to comment.