How to Deploy TGVCBot (<=v0.2.5) in a Ubuntu VPS

Contai, West Bengal, India
Search for a command to run...

Contai, West Bengal, India
No comments yet. Be the first to comment.
How I generate per-page Open Graph images at build time using satori and resvg-js - no edge runtime, no external service, just a custom Astro integration.

Ever wondered how you can keep your Telegram groups or online communities safe from inappropriate content automatically? It's actually easier than you might think! In this article, I'll walk you throu

Modern web and mobile applications typically use JWT (JSON Web Tokens) for authentication. These tokens expire after a certain period for security reasons, requiring a refresh mechanism to maintain us

When developing forms in React Native applications, we frequently encounter these challenges: Repetitive Code: Setting up input fields with proper styling and behavior for each form Validation Compl

Method chaining is a very useful and popular method in JavaScript and TypeScript which helps you write more readable and concise code. In this article, I will explain how method chaining works in JS/T

I wrote TGVCBot , Telegram bot+userbot to play music from JioSaavn and YouTube in the group voice chats. Here I am gonna explain how to make it work in your own VPS.
https://github.com/ArnabXD/TGVCBot
First SSH into your VPS and upgrade the packages
sudo apt-get update
sudo apt-get upgrade
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm i -g yarn pm2
sudo apt-get install git ffmpeg -y
git clone https://github.com/ArnabXD/TGVCBot.git
cd TGVCBot
yarn
yarn build
Knowing the Variables
| Name | Description | Required |
|---|---|---|
| API_ID | Your telegram app's API_ID. Get it from https://my.telegram.org/apps | True |
| API_HASH | Your telegram app's API_HASH. Get it from https://my.telegram.org/apps | True |
| BOT_TOKEN | Bot Token from @BotFather | True |
| LOG_CHANNEL | Chat ID of Channel/Group to keep logs. (Make sure to add VC User and Bot to the group) | True |
| SESSION | GramJS/Telethon session string of the VC User. Session Gen | True |
| MAX_DURATION | Set maximum duration of the stream. Default: 36000 seconds |
False |
| THUMBNAIL | Direct link for default thumbnail (used if audio has no thumbnails). | False |
Simply copy the .env.sample to .env
cp .env.sample .env
Now modify the .env with your values. Use your preferred text editor
Once you followed all the previous, now it's time to run the bot. I will use pm2 to run the bot.
pm2 start npm --name "tgvc" -- run start --exp-backoff-restart-delay=1000
this will auto-restart bot on crashes.
With PM2 we can start the bot automatically on VPS reboot too.
# save the pm2 list
pm2 save
# get startup command
pm2 startup
this will return a command. Execute that to start bot on VPS startup