Skip to content

Commit

Permalink
updated disgohook
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jun 7, 2021
1 parent 965a126 commit 51969ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dislog.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type DisLog struct {
webhookClient api.WebhookClient
lock sync.Mutex
queued bool
logQueue []*api.Embed
logQueue []api.Embed
levels []logrus.Level
}

Expand All @@ -98,7 +98,7 @@ func (l *DisLog) Close() {
l.sendEmbeds()
}

func (l *DisLog) queueEmbed(embed *api.Embed, forceSend bool) error {
func (l *DisLog) queueEmbed(embed api.Embed, forceSend bool) error {
l.logQueue = append(l.logQueue, embed)
if len(l.logQueue) >= MaxEmbeds || forceSend {
l.sendEmbeds()
Expand All @@ -114,7 +114,7 @@ func (l *DisLog) sendEmbeds() {
if len(l.logQueue) == 0 {
return
}
message := api.NewWebhookMessageBuilder()
message := api.NewWebhookMessageCreateBuilder()

for i := 0; i < len(l.logQueue); i++ {
if i >= MaxEmbeds {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/DisgoOrg/dislog
go 1.16

require (
github.com/DisgoOrg/disgohook v1.1.1
github.com/DisgoOrg/disgohook v1.2.0
github.com/DisgoOrg/log v1.0.3
github.com/sirupsen/logrus v1.8.1
)
14 changes: 12 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
github.com/DisgoOrg/disgohook v1.1.1 h1:tZi7FSmIvH/GjnkwLpgmvuX5fYmkOdqNAlfao6387mg=
github.com/DisgoOrg/disgohook v1.1.1/go.mod h1:FmGSn1CtzlqIzKOwX7xgOGntjToxCQIcF/K6kEuZaVY=
github.com/DisgoOrg/disgohook v1.2.0 h1:2GPiGrRNUSFUKOojT3Hpmb3oxqjO3fyncp7xiFjt84c=
github.com/DisgoOrg/disgohook v1.2.0/go.mod h1:s4p5MIKb/zyG5712iWHr5P1aFMhHE0TrjhyXOENo2+M=
github.com/DisgoOrg/log v1.0.3 h1:IjmZQQu/kuBIui22EdXmxzQGYwcPCJEkXa0Fe6W9fJk=
github.com/DisgoOrg/log v1.0.3/go.mod h1:KFGKhBQr37d6rxZ7p2bmc8BEmDH8DZbtgdlJDSCsE7I=
github.com/DisgoOrg/restclient v1.1.4 h1:mjl6bRfq8Lj2n0zpMV4hcozVF1AQioG1huiJSs5ZSjY=
github.com/DisgoOrg/restclient v1.1.4/go.mod h1:PIhyYsT52w5T6m4LT+HTdKqY6NOIqo71Ai0rgaq9ZtM=
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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
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/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 51969ce

Please sign in to comment.