tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
6.99k stars 1.43k forks source link

tdweb ".send is not a function." #2195

Closed Frostswing closed 1 year ago

Frostswing commented 1 year ago

How do i send a quary to tdlib using this directory?

my code starts as: "import React from "react"; import TdClient from "tdweb";

let client=class TdClient{} client.instanceName='tdlib'; client.isBackground='false'; client.jsLogVerbosityLevel='info'; client.logVerbosityLevel='2'; client.useDatabase='true'; client.readOnly='false'; client.mode='auto';

client.send(..."

then gets error:"TypeError: client.send is not a function."

i saw other issues here using this exact syntax, and i checked the documentation claiming to create an object and call the "send" function.

What am i missing?

Thanks!

levlam commented 1 year ago

You can look at source code of Telegram-react for an example of a correct usage of tdweb.

Frostswing commented 1 year ago

@levlam i just this morning found this Telegram-react project. Good to know that this is the right direction. Thanks!