Skip to content
This repository has been archived by the owner on Aug 8, 2021. It is now read-only.

Commit

Permalink
Hacky fix for message receives
Browse files Browse the repository at this point in the history
  • Loading branch information
cainy-a committed May 6, 2021
1 parent 5db229e commit 3836108
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/Bios-Marcel/shortnotforlong v1.1.1
github.com/alecthomas/chroma v0.7.3
github.com/atotto/clipboard v0.1.2
github.com/cainy-a/discordgo v0.23.2-1
github.com/cainy-a/discordgo v0.23.3-1
github.com/gdamore/tcell/v2 v2.0.0
github.com/gen2brain/beeep v0.0.0-20200526185328-e9c15c258e28
github.com/google/go-github/v29 v29.0.3
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkx
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY=
github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/cainy-a/discordgo v0.23.2-1 h1:MzYg58Kxjzzt7R2KR/B1PdU9E82PoLpPDXw29ce/tac=
github.com/cainy-a/discordgo v0.23.2-1/go.mod h1:L8KjpgTQeobAouKLrJh+khTYykMQEi8QJMwzlYmRqTs=
github.com/cainy-a/discordgo v0.23.3-1 h1:FBIES+ADLpKcs47mwuypkzuqrOjOcDrVYR6uAMKhVUY=
github.com/cainy-a/discordgo v0.23.3-1/go.mod h1:qMMF5ZSkIBi66IT7kvH6CikrI60f2OSTi38eEBfgSTQ=
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ=
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -87,15 +87,13 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af h1:6yITBqGTE2lEeTPG04SN9W+iWHCRyHqlVYILiSXziwk=
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+am0jAwlQLddpoMDM+iewkxxt6nxUQ5nq5o=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
5 changes: 3 additions & 2 deletions ui/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ func (window *Window) sendMessage(targetChannelID, message string, replyMsg *dis

var sendError error
if replyMsg != nil {
_, sendError = window.session.ChannelMessageSendReply(targetChannelID, message, replyMsg.Reference())
_, sendError = window.session.ChannelMessageSendReply(targetChannelID, message, replyMsg.Reference(), true)
} else {
_, sendError = window.session.ChannelMessageSend(targetChannelID, message)
}
Expand Down Expand Up @@ -1661,7 +1661,8 @@ func (window *Window) registerMouseFocusListeners() {

func (window *Window) registerMessageEventHandler(input, edit, delete chan *discordgo.Message, bulkDelete chan *discordgo.MessageDeleteBulk) {
window.session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
input <- m.Message
msg, _ := window.session.ChannelMessage(m.Message.ChannelID, m.Message.ID)
input <- msg
})
window.session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageDeleteBulk) {
bulkDelete <- m
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package version
// isn't really correct. Therefore new commits also won't lead to an update
// reminder, unless the latest tag is different to this number. This should
// not be touched manually.
var Version = "2021-04-19"
var Version = "2021-05-06"

0 comments on commit 3836108

Please sign in to comment.