Comments (9)
go-tdlib supports the new client design already.
#45
from go-tdlib.
Hm, it seems that doesn't work for me. I get this error just at the time of a second client creation (custom listeners are even not created yet). I tried go-tdlib 0.4 with tdlib 1.7.0.
from go-tdlib.
2netwalkers
This short example will give you error:
[ 0][t 0][1618062097.475765943][Client.cpp:277] Receive is called after Client destroy, or simultaneously from different threads
So, I decided to make some small changes to my app and restrict it with one telegram client per instance, because I don't see an easy way to support multiple clients right now.
package main
import (
"log"
"path/filepath"
"time"
"github.com/zelenin/go-tdlib/client"
)
func getClient(d string) {
// client authorizer
authorizer := client.ClientAuthorizer()
go client.CliInteractor(authorizer)
const (
apiId = 00000
apiHash = "8pu9yg32qkuukj83ozaqo5zzjwhkxhnk"
)
authorizer.TdlibParameters <- &client.TdlibParameters{
UseTestDc: false,
DatabaseDirectory: filepath.Join(d + "/.tdlib", "database"),
FilesDirectory: filepath.Join(d + "/.tdlib", "files"),
UseFileDatabase: true,
UseChatInfoDatabase: true,
UseMessageDatabase: true,
UseSecretChats: false,
ApiId: apiId,
ApiHash: apiHash,
SystemLanguageCode: "en",
DeviceModel: "Server",
SystemVersion: "1.0.0",
ApplicationVersion: "1.0.0",
EnableStorageOptimizer: true,
IgnoreFileNames: false,
}
logVerbosity := client.WithLogVerbosity(&client.SetLogVerbosityLevelRequest{
NewVerbosityLevel: 0,
})
c, err := client.NewClient(authorizer, logVerbosity)
me, err := c.GetMe()
if err != nil {
log.Fatalf("GetMe error: %s", err)
}
log.Printf("Me: %s %s [%s]", me.FirstName, me.LastName, me.Username)
}
func main() {
go getClient("a")
go getClient("b")
time.Sleep(900 * time.Second)
}
from go-tdlib.
@livelace i will check it
from go-tdlib.
Same problem :( Have to downgrade.
from go-tdlib.
[ 0][t 0][1619345016.295426607][Client.cpp:277] Receive is called after Client destroy, or simultaneously from different threads
from go-tdlib.
Any news?
from go-tdlib.
DatabaseDirectory: filepath.Join(d + "/.tdlib", "database"),
FilesDirectory: filepath.Join(d + "/.tdlib", "files"),
can write different path to fix?
from go-tdlib.
fixed in e5d2ffd
from go-tdlib.
Related Issues (20)
- Could you help with build (make) app errors HOT 1
- build error on Centos but work on ubuntu20.04 HOT 2
- often response catching timeout HOT 3
- [FreeBSD Build Issue] d: error: undefined symbol: td_create_client_id
- GetMe timeout HOT 9
- Can this feature be updated?
- Receive Updates HOT 1
- textEntityTypeQuote HOT 1
- the library didn't try to receive updates anymore when running a while HOT 6
- SetProfilePhoto got error. HOT 1
- receive channel is fulled HOT 4
- how to restart client ?
- Fail to run on Windows build HOT 2
- Can someone show the references of the SetAuthenticationPhoneNumber() function HOT 1
- Error: json: cannot unmarshal object into Go struct field Messages.messages of type []*client.MessageReaction HOT 1
- After few minutes of running listener stops getting updates HOT 4
- can't build project on Ubuntu 22.04
- "Issue with Reply Messages in Telegram: 'this reply from a private chat' Error When Clicking on Reply"
- SetAutoDownloadSettings not working HOT 1
- how to get ArchivedChats?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-tdlib.