diff --git a/README.md b/README.md index 8a46931..5b0155c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Golang interface for ICQ bot API +# Golang interface for bot API [![CircleCI](https://circleci.com/gh/DmitryDorofeev/goicqbot.svg?style=svg)](https://circleci.com/gh/DmitryDorofeev/goicqbot) - *Brand new Bot API!* @@ -11,7 +11,7 @@ ## Install ```bash -go get github.com/DmitryDorofeev/goicqbot +go get github.com/mail-ru-im/bot-golang ``` ## Usage @@ -25,10 +25,10 @@ Note a bot can only reply after the user has added it to his contacts list, or i ```go package main -import "github.com/DmitryDorofeev/goicqbot" +import "github.com/mail-ru-im/bot-golang" func main() { - bot, err := goicqbot.NewBot(BOT_TOKEN) + bot, err := botgolang.NewBot(BOT_TOKEN) if err != nil { log.Println("wrong token") } @@ -75,13 +75,12 @@ You don't need this. But if you do, you can override bot's API URL: ```go -bot := goicqbot.NewBot(BOT_TOKEN, goicqbot.BotApiURL("https://agent.mail.ru/bot/v1")) +bot := botgolang.NewBot(BOT_TOKEN, botgolang.BotApiURL("https://agent.mail.ru/bot/v1")) ``` - And debug all api requests and responses: ```go -bot := goicqbot.NewBot(BOT_TOKEN, goicqbot.BotDebug(true)) +bot := botgolang.NewBot(BOT_TOKEN, botgolang.BotDebug(true)) ``` diff --git a/api_mock.go b/api_mock.go index 91d6193..240b692 100644 --- a/api_mock.go +++ b/api_mock.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang import ( "encoding/json" diff --git a/bot.go b/bot.go index 3db8688..99542fd 100644 --- a/bot.go +++ b/bot.go @@ -1,7 +1,7 @@ -package goicqbot +package botgolang /* -💥 GoICQBot is zero-configuration library with convenient interface. +💥 botgolang is zero-configuration library with convenient interface. Crafted with love in @mail for your awesome bots. */ @@ -18,7 +18,7 @@ const ( defaultDebug = false ) -// Bot is the main structure for interaction with ICQ API. +// Bot is the main structure for interaction with API. // All fields are private, you can configure bot using config arguments in NewBot func. type Bot struct { ctx context.Context @@ -146,7 +146,7 @@ func (b *Bot) GetUpdatesChannel(ctx context.Context) <-chan Event { } // NewBot returns new bot object. -// All communications with ICQ bot API must go through Bot struct. +// All communications with bot API must go through Bot struct. // In general you don't need to configure this bot, therefore all options are optional arguments. func NewBot(token string, opts ...BotOption) (*Bot, error) { logger := logrus.New() diff --git a/chat.go b/chat.go index d3e6dbd..8095b1f 100644 --- a/chat.go +++ b/chat.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang //go:generate easyjson -all chat.go diff --git a/chat_easyjson.go b/chat_easyjson.go index 77100b5..bd080f2 100644 --- a/chat_easyjson.go +++ b/chat_easyjson.go @@ -1,6 +1,6 @@ // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package goicqbot +package botgolang import ( json "encoding/json" @@ -17,7 +17,7 @@ var ( _ easyjson.Marshaler ) -func easyjson9b8f5552DecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out *Chat) { +func easyjson9b8f5552DecodeGithubComMailRuImBotgolang(in *jlexer.Lexer, out *Chat) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -81,7 +81,7 @@ func easyjson9b8f5552DecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out in.Consumed() } } -func easyjson9b8f5552EncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, in Chat) { +func easyjson9b8f5552EncodeGithubComMailRuImBotgolang(out *jwriter.Writer, in Chat) { out.RawByte('{') first := true _ = first @@ -137,23 +137,23 @@ func easyjson9b8f5552EncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Chat) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson9b8f5552EncodeGithubComDmitryDorofeevGoicqbot(&w, v) + easyjson9b8f5552EncodeGithubComMailRuImBotgolang(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Chat) MarshalEasyJSON(w *jwriter.Writer) { - easyjson9b8f5552EncodeGithubComDmitryDorofeevGoicqbot(w, v) + easyjson9b8f5552EncodeGithubComMailRuImBotgolang(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Chat) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson9b8f5552DecodeGithubComDmitryDorofeevGoicqbot(&r, v) + easyjson9b8f5552DecodeGithubComMailRuImBotgolang(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Chat) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson9b8f5552DecodeGithubComDmitryDorofeevGoicqbot(l, v) + easyjson9b8f5552DecodeGithubComMailRuImBotgolang(l, v) } diff --git a/client.go b/client.go index 94d1394..ea67480 100644 --- a/client.go +++ b/client.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang import ( "bytes" diff --git a/client_test.go b/client_test.go index 24a0b5a..4340c5f 100644 --- a/client_test.go +++ b/client_test.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang import ( "net/http" diff --git a/example/main.go b/example/main.go index e5a2338..bac39ff 100644 --- a/example/main.go +++ b/example/main.go @@ -7,13 +7,13 @@ import ( "os" "time" - "github.com/DmitryDorofeev/goicqbot" + "github.com/mail-ru-im/bot-golang" ) func main() { token := os.Getenv("TOKEN") - bot, err := goicqbot.NewBot(token, goicqbot.BotDebug(true)) + bot, err := botgolang.NewBot(token, botgolang.BotDebug(true)) if err != nil { log.Fatalf("cannot connect to bot: %s", err) } @@ -53,12 +53,12 @@ func main() { for update := range updates { fmt.Println(update.Type, update.Payload) switch update.Type { - case goicqbot.NEW_MESSAGE: + case botgolang.NEW_MESSAGE: message := update.Payload.Message() if err := message.Send(); err != nil { log.Printf("something went wrong: %s", err) } - case goicqbot.EDITED_MESSAGE: + case botgolang.EDITED_MESSAGE: message := update.Payload.Message() message.Reply("do not edit!") } diff --git a/file.go b/file.go index 666da3e..e148875 100644 --- a/file.go +++ b/file.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang //go:generate easyjson -all file.go diff --git a/file_easyjson.go b/file_easyjson.go index 5619f89..93d1fe6 100644 --- a/file_easyjson.go +++ b/file_easyjson.go @@ -1,6 +1,6 @@ // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package goicqbot +package botgolang import ( json "encoding/json" @@ -17,7 +17,7 @@ var ( _ easyjson.Marshaler ) -func easyjson8ceb9162DecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out *File) { +func easyjson8ceb9162DecodeGithubComMailRuImBotgolang(in *jlexer.Lexer, out *File) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -56,7 +56,7 @@ func easyjson8ceb9162DecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out in.Consumed() } } -func easyjson8ceb9162EncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, in File) { +func easyjson8ceb9162EncodeGithubComMailRuImBotgolang(out *jwriter.Writer, in File) { out.RawByte('{') first := true _ = first @@ -91,23 +91,23 @@ func easyjson8ceb9162EncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v File) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson8ceb9162EncodeGithubComDmitryDorofeevGoicqbot(&w, v) + easyjson8ceb9162EncodeGithubComMailRuImBotgolang(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v File) MarshalEasyJSON(w *jwriter.Writer) { - easyjson8ceb9162EncodeGithubComDmitryDorofeevGoicqbot(w, v) + easyjson8ceb9162EncodeGithubComMailRuImBotgolang(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *File) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson8ceb9162DecodeGithubComDmitryDorofeevGoicqbot(&r, v) + easyjson8ceb9162DecodeGithubComMailRuImBotgolang(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *File) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson8ceb9162DecodeGithubComDmitryDorofeevGoicqbot(l, v) + easyjson8ceb9162DecodeGithubComMailRuImBotgolang(l, v) } diff --git a/go.mod b/go.mod index 3c76bc3..5e742a2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/DmitryDorofeev/goicqbot +module github.com/mail-ru-im/bot-golang go 1.12 diff --git a/go.sum b/go.sum index e614865..96e0a0f 100644 --- a/go.sum +++ b/go.sum @@ -4,11 +4,10 @@ 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/hako/durafmt v0.0.0-20190612201238-650ed9f29a84 h1:RvcDqcKLua4b/jtXez7ZVe9s6Iq5N6ujVevqY4FBQmM= github.com/hako/durafmt v0.0.0-20190612201238-650ed9f29a84/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6 h1:qsqscDgSJy+HqgMTR+3NwjYJBbp1+honwDsszLoS+pA= -github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= 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.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= diff --git a/message.go b/message.go index b22559e..72f994b 100644 --- a/message.go +++ b/message.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang import ( "fmt" @@ -17,7 +17,7 @@ const ( Voice ) -// Message represents a text message in ICQ +// Message represents a text message type Message struct { client *Client ContentType MessageContentType diff --git a/message_easyjson.go b/message_easyjson.go index b457a13..1e61987 100644 --- a/message_easyjson.go +++ b/message_easyjson.go @@ -1,6 +1,6 @@ // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package goicqbot +package botgolang import ( json "encoding/json" @@ -17,7 +17,7 @@ var ( _ easyjson.Marshaler ) -func easyjson4086215fDecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out *Message) { +func easyjson4086215fDecodeGithubComMailRuImBotgolang(in *jlexer.Lexer, out *Message) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -36,6 +36,8 @@ func easyjson4086215fDecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out continue } switch key { + case "ContentType": + out.ContentType = MessageContentType(in.Uint8()) case "msgId": out.ID = string(in.String()) case "fileId": @@ -62,13 +64,18 @@ func easyjson4086215fDecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out in.Consumed() } } -func easyjson4086215fEncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, in Message) { +func easyjson4086215fEncodeGithubComMailRuImBotgolang(out *jwriter.Writer, in Message) { out.RawByte('{') first := true _ = first { - const prefix string = ",\"msgId\":" + const prefix string = ",\"ContentType\":" out.RawString(prefix[1:]) + out.Uint8(uint8(in.ContentType)) + } + { + const prefix string = ",\"msgId\":" + out.RawString(prefix) out.String(string(in.ID)) } { @@ -112,23 +119,23 @@ func easyjson4086215fEncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Message) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4086215fEncodeGithubComDmitryDorofeevGoicqbot(&w, v) + easyjson4086215fEncodeGithubComMailRuImBotgolang(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Message) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4086215fEncodeGithubComDmitryDorofeevGoicqbot(w, v) + easyjson4086215fEncodeGithubComMailRuImBotgolang(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Message) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4086215fDecodeGithubComDmitryDorofeevGoicqbot(&r, v) + easyjson4086215fDecodeGithubComMailRuImBotgolang(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4086215fDecodeGithubComDmitryDorofeevGoicqbot(l, v) + easyjson4086215fDecodeGithubComMailRuImBotgolang(l, v) } diff --git a/options.go b/options.go index bb3c005..0d505a0 100644 --- a/options.go +++ b/options.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang type BotOption interface { Type() string diff --git a/types.go b/types.go index b74c911..25445f9 100644 --- a/types.go +++ b/types.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang //go:generate easyjson -all types.go diff --git a/types_easyjson.go b/types_easyjson.go index 9f9bc16..4266994 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -1,6 +1,6 @@ // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package goicqbot +package botgolang import ( json "encoding/json" @@ -17,7 +17,7 @@ var ( _ easyjson.Marshaler ) -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out *eventsResponse) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang(in *jlexer.Lexer, out *eventsResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -79,7 +79,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot(in *jlexer.Lexer, out in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, in eventsResponse) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang(out *jwriter.Writer, in eventsResponse) { out.RawByte('{') first := true _ = first @@ -114,27 +114,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v eventsResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v eventsResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *eventsResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *eventsResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot1(in *jlexer.Lexer, out *Response) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang1(in *jlexer.Lexer, out *Response) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -167,7 +167,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot1(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot1(out *jwriter.Writer, in Response) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang1(out *jwriter.Writer, in Response) { out.RawByte('{') first := true _ = first @@ -187,27 +187,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot1(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Response) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot1(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Response) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot1(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Response) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot1(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot1(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang1(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot2(in *jlexer.Lexer, out *Photo) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang2(in *jlexer.Lexer, out *Photo) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -238,7 +238,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot2(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot2(out *jwriter.Writer, in Photo) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang2(out *jwriter.Writer, in Photo) { out.RawByte('{') first := true _ = first @@ -253,27 +253,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot2(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Photo) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot2(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang2(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Photo) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot2(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang2(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Photo) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot2(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang2(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Photo) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot2(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang2(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot3(in *jlexer.Lexer, out *PartPayload) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang3(in *jlexer.Lexer, out *PartPayload) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -316,7 +316,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot3(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot3(out *jwriter.Writer, in PartPayload) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang3(out *jwriter.Writer, in PartPayload) { out.RawByte('{') first := true _ = first @@ -361,27 +361,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot3(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v PartPayload) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot3(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang3(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v PartPayload) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot3(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang3(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *PartPayload) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot3(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang3(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *PartPayload) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot3(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang3(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot4(in *jlexer.Lexer, out *PartMessage) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang4(in *jlexer.Lexer, out *PartMessage) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -418,7 +418,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot4(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot4(out *jwriter.Writer, in PartMessage) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang4(out *jwriter.Writer, in PartMessage) { out.RawByte('{') first := true _ = first @@ -448,27 +448,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot4(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v PartMessage) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot4(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang4(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v PartMessage) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot4(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang4(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *PartMessage) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot4(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang4(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *PartMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot4(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang4(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot5(in *jlexer.Lexer, out *Part) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang5(in *jlexer.Lexer, out *Part) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -501,7 +501,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot5(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot5(out *jwriter.Writer, in Part) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang5(out *jwriter.Writer, in Part) { out.RawByte('{') first := true _ = first @@ -521,27 +521,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot5(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Part) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot5(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang5(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Part) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot5(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang5(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Part) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot5(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang5(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Part) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot5(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang5(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot6(in *jlexer.Lexer, out *EventPayload) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang6(in *jlexer.Lexer, out *EventPayload) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -653,7 +653,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot6(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot6(out *jwriter.Writer, in EventPayload) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang6(out *jwriter.Writer, in EventPayload) { out.RawByte('{') first := true _ = first @@ -746,27 +746,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot6(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventPayload) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot6(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang6(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventPayload) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot6(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang6(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventPayload) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot6(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang6(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventPayload) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot6(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang6(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot7(in *jlexer.Lexer, out *Event) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang7(in *jlexer.Lexer, out *Event) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -801,7 +801,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot7(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot7(out *jwriter.Writer, in Event) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang7(out *jwriter.Writer, in Event) { out.RawByte('{') first := true _ = first @@ -826,27 +826,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot7(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Event) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot7(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang7(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Event) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot7(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang7(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Event) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot7(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang7(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot7(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang7(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot8(in *jlexer.Lexer, out *Contact) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang8(in *jlexer.Lexer, out *Contact) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -881,7 +881,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot8(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot8(out *jwriter.Writer, in Contact) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang8(out *jwriter.Writer, in Contact) { out.RawByte('{') first := true _ = first @@ -906,27 +906,27 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot8(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Contact) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot8(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang8(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Contact) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot8(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang8(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Contact) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot8(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang8(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Contact) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot8(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang8(l, v) } -func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot9(in *jlexer.Lexer, out *BotInfo) { +func easyjson6601e8cdDecodeGithubComMailRuImBotgolang9(in *jlexer.Lexer, out *BotInfo) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -986,7 +986,7 @@ func easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot9(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot9(out *jwriter.Writer, in BotInfo) { +func easyjson6601e8cdEncodeGithubComMailRuImBotgolang9(out *jwriter.Writer, in BotInfo) { out.RawByte('{') first := true _ = first @@ -1032,23 +1032,23 @@ func easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot9(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v BotInfo) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot9(&w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang9(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BotInfo) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComDmitryDorofeevGoicqbot9(w, v) + easyjson6601e8cdEncodeGithubComMailRuImBotgolang9(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BotInfo) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot9(&r, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang9(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BotInfo) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComDmitryDorofeevGoicqbot9(l, v) + easyjson6601e8cdDecodeGithubComMailRuImBotgolang9(l, v) } diff --git a/updates.go b/updates.go index 65c89e6..428b28d 100644 --- a/updates.go +++ b/updates.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang import ( "context" diff --git a/voice.go b/voice.go index 949295f..a77fc23 100644 --- a/voice.go +++ b/voice.go @@ -1,4 +1,4 @@ -package goicqbot +package botgolang var ( voiceMessageSupportedExtensions = map[string]bool{