Giter VIP home page Giter VIP logo

Comments (9)

levlam avatar levlam commented on July 19, 2024

Do you have a high-speed internet connection on the server where the Bot API server is hosted?

You can enable logs by adding parameters -v4 -l log.txt to the Bot API server and send the file log.txt to https://t.me/tdlib_bot to know the exact reason.

from telegram-bot-api.

kupeepla avatar kupeepla commented on July 19, 2024

Yes its 1gbps unshared. ( dedicated server )
btw, my bot is a kind of downloader where user sends the instagram post link ( image / video ) and they get the media file. on api.telegram.org it happens in a blink of an eye but on locally it takes 1-2 mins

specially video when i try to send the video i get this error

An error occurred while sending video to user : invalid json response body at http://<DOMAIN.com?/bot/sendVideo reason: Unexpected token < in JSON at position 0

also should i user IP:PORT or domain.com and with http or https ?

from telegram-bot-api.

levlam avatar levlam commented on July 19, 2024

Why do use domain at all and don't host the Bot API server on the same server as the bot?

from telegram-bot-api.

kupeepla avatar kupeepla commented on July 19, 2024

Bot and BOT API both are hosted on same server, i think because i am using HTTP://ip:port and not HTTPS my download/upload speed is capped to certain kbps maybe

And i thought if i use HTTPS with domain name i will get good speeds

What to do ?

P.S. https://t.me/tdlib_bot not responding

from telegram-bot-api.

levlam avatar levlam commented on July 19, 2024

Bot and BOT API both are hosted on same server,

Then you should send request to http://127.0.0.1:. You should also consider to send local files using file:// URI scheme as specified in https://github.com/tdlib/telegram-bot-api?tab=readme-ov-file#usage.

from telegram-bot-api.

kupeepla avatar kupeepla commented on July 19, 2024

Files are not on the disk i am sending media link directly to user using replywithVideo / replywithphoto with url,
My bot really works fast on api.telegram.org and i am using same sending methods and i do succeed its just that its super slow on BOT API

botlogs.txt

These are my logs,

from telegram-bot-api.

levlam avatar levlam commented on July 19, 2024

In the log upload speed is less than 1 megabit per second. The speed depends on your server and there is no way to upload files with a higher speed.

from telegram-bot-api.

kupeepla avatar kupeepla commented on July 19, 2024
image

This is my speed tests, also download and uploading speed on other apps are very impressive

from telegram-bot-api.

kupeepla avatar kupeepla commented on July 19, 2024

thats the sample code

const { Telegraf } = require('telegraf');

const bot = new Telegraf('', {
telegram: {
apiRoot: 'http://IP:PORT' },
});

bot.start((ctx) => ctx.reply('Welcome! Use /send to get a video.'));

bot.command('send', (ctx) => {
const videoUrl = '';
ctx.replyWithVideo(videoUrl);
});

bot.launch();

from telegram-bot-api.

Related Issues (20)

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.