How to keep progress of server when reconnecting?

My goal is to run a discord.py discord bot 24/7

When i connect to SSH with Bitvise and run the python file it works fine until i close Bitwise when it resets and when i reconnect the console i get is cd'd in localhost even though i left it in a different folder and the python script stops running.

I've follow a youtube video and changed my firewall settings

ufw default deny incoming
ufw default allow outgoing
ufw allow 2
ufw enable

1 Reply

  1. Log in to your Linux server via SSH.

  2. Run the command "screen -S <name-of-session>". This will create a new screen session with the name you specified.</name-of-session>

  3. Run the command "cd <location-of-bot-files>". This will move you to the directory containing your Discord bot files.</location-of-bot-files>

  4. Run the command "node bot.js" to start your Discord bot.

  5. Now your Discord bot is running in a screen session. To view the session, run the command "screen -r <name-of-session>".</name-of-session>

  6. To disconnect from the session without stopping the bot, press Ctrl+A then Ctrl+D.

~ Andy | NexusPIPE

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct