Giter VIP home page Giter VIP logo

bot-golang's People

Contributors

aidarazizov avatar bulletmys avatar dependabot[bot] avatar dmitrydorofeev avatar gabolaev avatar ksenobait09 avatar toxasemenov avatar vkryuchenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bot-golang's Issues

Cleanup modules

I'm create new project:
go mod init icqbot
And use this package in very simple code from example:
`package main
import "github.com/mail-ru-im/bot-golang"

func main() {
_, _ := botgolang.NewBot("0000")
}Then build this with:go build main.goI'm receive this error:go: finding github.com/mail-ru-im/bot-golang latest
go: github.com/mail-ru-im/[email protected] requires
github.com/golangci/[email protected] requires
github.com/go-critic/[email protected]: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)`

Unable to parse messages of type inlineKeyboardMarkup

When receiving latest updates via GetLastEventsWithContext with any message that contains an event of type inlineKeyboardMarkup, bot is unable to unmarshal it and enters an infinite loop, while constantly building a queue of unresolved events

time="..." level=error msg="Failed to get updates, retrying in 3 seconds ..." err="cannot get events: cannot parse events: parse error: expected { near offset 275 of 'payload'" retry interval="3 seconds"
time="..." level=error msg="Failed to get updates, retrying in 3 seconds ..." err="cannot get events: cannot parse events: parse error: expected { near offset 275 of 'payload'" retry interval="3 seconds"
time="..." level=error msg="Failed to get updates, retrying in 3 seconds ..." err="cannot get events: cannot parse events: parse error: expected { near offset 275 of 'payload'" retry interval="3 seconds"

file.go File: поле Name имеет тип bool

При вызове метода Bot.GetFileInfo с корректным fileId всегда возвращается ошибка "error while unmarshalling information: ...", т.к. в структуре File поле Name имеет тип bool, а метод API ICQ /files/getInfo возвращает в поле filename строку.

См. схему на https://icq.com/botapi/#/files/get_files_getInfo

file.go

type File struct {
	// Id of the file
	ID string `json:"fileId"`

	// Type of the file
	Type string `json:"type"`

	// Size in bytes
	Size uint64 `json:"size"`

	// Name of file
	Name bool `json:"filename"`

	// URL to the file
	URL string `json:"url"`
}

при замене типа на string ошибка уходит.

При отправке сообщения с файлом (метод client.go/UploadFile(message *Message)) невозможно отправить форматированный текст

Если в сообщении с файлом есть форматированный текст, то форматирование не применяется потому что parseMode не проставляется. Есть возможность проставлять в params еще parseMode?

NewFileMessage принимает только *os.File

Ребят, а нельзя поставить что-то более удобное типа io.Reader? Судя по всему библиотека не позволяет отправить файл в виде байтов, например если он был сгенерирован. Придется обязательно его локально сохранить и передать вам в виде *os.File.

Context not passed to GetEvents from updater

Steps to reproduce:

  • Call GetUpdatesChannel with high poll times
  • cancel the context

Expected behaviour:
current longpoll request is cancelled

Actual behaviour:
context is only used inside of poller, GetUpdates calls ignore the context

Custom HTTP Client

there's no way to use custom http client with this library :(

maybe a new BotOption should be added to set the http client?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.