1

I have been hosting a discord bot on my raspberry pi for half a year now, but after the new discord update my bot seems to go offline within two hours of closing out my PuTTy shell and vnc viewer which I use to access my raspberry pi. After testing different things when I try and restart the bot via vnc I get a Temporary Failure in name resolution which I learned only goes away if I rewrite my token in the script using PuTTY however this put me in a loop because 2 hours after closing out of the PuTTy shell the bot goes offline again and I have to repeat the process. I am still relatively new to all of this and would really like any kind of help.

edit: I just found out that I don't even need a new token to get rid of the error all I need to do is run it in PuTTy and close it immedietly when I do the same thing through the vnc viewer nothing happens and the error persists.

Ian K
  • 11
  • 3
  • Name resolution errors mean that ur internet connection or the DNS servers have some problem. – Raz Crimson Jul 24 '20 at 20:16
  • The error goes away immediately when the script is opened and closed in PuTTy for some reason, i'm not sure why. and the error still persists when I open it through vnc. after running it through vnc the bot goes offline after a while when putty is closed. – Ian K Jul 24 '20 at 20:23
  • Can you show us the error logs? – Raz Crimson Jul 24 '20 at 20:25
  • when the bot goes offline I get no errors even through the console, it just acts like its online but it doesn't respond to any commands or anything. when I restart it without first opening it in putty here is the name resolution failure I get: ``` – Ian K Jul 24 '20 at 20:29
  • ``` raise ClientConnectorError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discordapp.com:443 ssl:default [Temporary failure in name resolution] ``` sorry it took a while I am not able to copy with vnc viewer so I had to type that by hand. – Ian K Jul 24 '20 at 20:40
  • Sounds like you might have intermittent issues, which you should handle in your script - if the network drops, you should attempt to automatically reestablish the connection - vs letting the script quit in an error. – Matt Clark Jul 24 '20 at 23:11
  • I know that the discord.py auto reconnects itself if the power goes out and ive seen it work a few times when I run the code on another computer, but you could be right if my bot is timing out or something every few hours I will look into that, thanks. – Ian K Jul 24 '20 at 23:44
  • it doesn't seem like anything is timing out and the console remains error free and running even when it is clearly offline. – Ian K Jul 25 '20 at 01:23

0 Answers0