Upgrade Arikawa to v3 (#15)

This commit is contained in:
rigormorrtiss 2021-08-02 20:07:50 +04:00 • committed by GitHub
parent d0a372c414
commit 9bc0b94da3
4 changed files with 14 additions and 14 deletions

View file

@ -1,15 +1,16 @@
package main
import (
"context"
"sort"
"strings"
"github.com/diamondburned/arikawa/v2/api"
"github.com/diamondburned/arikawa/v2/discord"
"github.com/diamondburned/arikawa/v2/gateway"
"github.com/diamondburned/arikawa/v2/session"
"github.com/diamondburned/arikawa/v2/state"
"github.com/diamondburned/arikawa/v2/state/store/defaultstore"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/session"
"github.com/diamondburned/arikawa/v3/state"
"github.com/diamondburned/arikawa/v3/state/store/defaultstore"
"github.com/gdamore/tcell/v2"
"github.com/rigormorrtiss/discordo/ui"
"github.com/rigormorrtiss/discordo/util"
@ -119,7 +120,7 @@ func newSession(email string, password string, token string) *session.Session {
sess.AddHandler(onReady)
sess.AddHandler(onGuildCreate)
sess.AddHandler(onMessageCreate)
if err = sess.Open(); err != nil {
if err = sess.Open(context.Background()); err != nil {
panic(err)
}
@ -192,7 +193,6 @@ func onChannelsTreeViewSelected(node *tview.TreeNode) {
}
currentChannel = node.GetReference().(discord.Channel)
switch currentChannel.Type {
case discord.GuildCategory:
if len(node.GetChildren()) == 0 {
@ -236,7 +236,7 @@ func onMessageInputFieldDone(key tcell.Key) {
return
}
discordSession.SendText(currentChannel.ID, currentText)
discordSession.SendMessage(currentChannel.ID, currentText)
messageInputField.SetText("")
}

2
go.mod
View file

@ -3,7 +3,7 @@ module github.com/rigormorrtiss/discordo
go 1.16
require (
github.com/diamondburned/arikawa/v2 v2.1.0
github.com/diamondburned/arikawa/v3 v3.0.0-20210711201954-9651328b74d3
github.com/gdamore/tcell/v2 v2.3.11
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2
github.com/zalando/go-keyring v0.1.1

4
go.sum
View file

@ -2,8 +2,8 @@ github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Y
github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/diamondburned/arikawa/v2 v2.1.0 h1:nyX5TEf7kuSdCTiZDMlURbabKrLTqPQGDBqnwX+qF9E=
github.com/diamondburned/arikawa/v2 v2.1.0/go.mod h1:e+lhS20ni2luFEU06Pc8paCxgZL99/RZb77dOC82CF0=
github.com/diamondburned/arikawa/v3 v3.0.0-20210711201954-9651328b74d3 h1:pkLTxFSFSgjHd8234CuO6lgb2GOZ8m1vI1sbusx5c8Y=
github.com/diamondburned/arikawa/v3 v3.0.0-20210711201954-9651328b74d3/go.mod h1:sNqM/iGXuH87wEH1rpQBEY1PR0AAkRKJuUhJGOdo7To=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.3.3/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=

View file

@ -6,8 +6,8 @@ import (
_ "image/png"
"strings"
"github.com/diamondburned/arikawa/v2/discord"
"github.com/diamondburned/arikawa/v2/state"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/state"
"github.com/rivo/tview"
)