Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vildan-valeev committed Apr 28, 2024
1 parent 4ffef19 commit 12a0633
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion example/keyboards/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (b *Bot) Update(update *gvk.Update) {
}

func (b *Bot) EntryHandler(update *gvk.Update) stateFn {
fmt.Println("INCOME TEXT", update.Object.MessageNew.Message.Text)
if strings.HasPrefix(update.Object.MessageNew.Message.Text, "ping") {
buttons := make([][]gvk.Button, 0)
buttons = append(buttons, []gvk.Button{
Expand Down
4 changes: 2 additions & 2 deletions example/wall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (b *Bot) EntryHandler(update *gvk.Update) stateFn {
if strings.HasPrefix(update.Object.MessageNew.Message.Text, "ping") {
b.MessagesSend(&gvk.MessagesSendOptions{Message: "pong to channel...", UserID: b.chatID})

poster := gvk.NewAPI(tokenPosting) // https://oauth.vk.com/authorize?client_id=APP_ID&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=wall,offline&response_type=token&v=5.199
poster := gvk.NewAPI(token) // https://oauth.vk.com/authorize?client_id=APP_ID&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=wall,offline&response_type=token&v=5.199
opt := gvk.WallPostOptions{
Message: "pong 1",
OwnerID: -groupID,
Expand All @@ -61,7 +61,7 @@ func (b *Bot) EntryHandler(update *gvk.Update) stateFn {

func (b *Bot) handleNext(update *gvk.Update) stateFn {

poster := gvk.NewAPI(tokenPosting)
poster := gvk.NewAPI(token)
opt := gvk.WallPostOptions{
Message: "pong 2",
OwnerID: -groupID,
Expand Down
2 changes: 0 additions & 2 deletions requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
)
Expand Down Expand Up @@ -79,7 +78,6 @@ func check(r Response) error {
return nil
// TODO: add another codes https://vk.com/dev/errors
default:
log.Println(e.Error())
return e
}
}
4 changes: 0 additions & 4 deletions responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ func (u *Update) ChatID() int64 {
}

func (a RawUpdates) UnmarshalCustom() (Updates, error) {
//if len(a) > 0 {
// fmt.Println("COUNT UPDATES", len(a))
//}

var updates Updates
for _, row := range a {
update := Update{}
Expand Down

0 comments on commit 12a0633

Please sign in to comment.