Using the nuget window in your IDE, add Telegram.Bot
and Telegram.Bot.Extensions.Polling
to your packages.
Type these commands in your terminal and press enter after each one.
dotnet add package Telegram.Bot
dotnet add package Telegram.Bot.Extensions.Polling
Type this command in your terminal and press enter.
dotnet publish -c release --self-contained --runtime linux-x64
Copy everything from bin/release/netXXX/linux-x64
to your TBotRemote
folder.
Type this command in your terminal and press enter.
dotnet build
Copy everything from bin/release/net6.0
to your TBotRemote
folder.
Type these commands in your server terminal and press enter after each one.
cd TBotRemote
chmod +x TutorialBot
./TutorialBot
Type these commands in your server terminal and press enter after each one.
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-runtime-6.0
Now that you have installed the runtime environment, run:
cd TBotRemote
dotnet TutorialBot.dll
Type this command in your terminal and press enter.
pip install python-telegram-bot==13.12
Copy your source file from your project folder to your TBotRemote
folder.
Type this command in your terminal and press enter.
cd TBotRemote
python TutorialBot.py
Type these commands in your terminal and press enter after each one.
go mod init example.com/TutorialBot
go mod tidy
You can use source file as executables using go run TutorialBot.go
You can build a static executable.
Type this command in your terminal and press enter.
Nix Shell
GOOS=linux GOARCH=amd64 go build -o bot
Powershell
$env:GOOS='linux'; $env:GOARCH='amd64'; go build -o bot
Please replace GOOS
and GOARCH
according to your target machine.
If you're running source files directly, you'll need an up-to-date version of the Golang runtime.
Once you have installed it, type this command in your terminal and press enter.
go run bot.go
If you're running the static executable, type these commands in your terminal and press enter after each one.
cd TBotRemote
chmod +x TutorialBot
./TutorialBot
Type these commands in your terminal and press enter.
sudo apt-get update
sudo apt-get install -y nodejs
npm install
Copy your source file and package.json
file from your project folder to your TBotRemote
folder.
Type these commands in your terminal and press enter.
cd TBotRemote
npm install
npm start