title: Twitter filtered stream operational disconnects
body: <p>I've created a discord bot that runs on a raspberry pi 4, which shares tweets from specific users. The stream part of the code is inspired by this one:</p>
  <p><a href="https://github.com/bradtraversy/real-time-tweet-stream" rel="nofollow noreferrer">https://github.com/bradtraversy/real-time-tweet-stream</a></p>
  <p>I’m listening to a filtered stream and get operational disconnects every now and then. The exact error message is:</p>
  <pre class="lang-sh prettyprint-override"><code>{
  errors: [
  {
  title: ‘operational-disconnect’,
  disconnect_type: ‘UpstreamOperationalDisconnect’,
  detail: ‘This stream has been disconnected upstream for operational reasons.’,
  type: ‘link removed for forum rules’
  }
  ]
  }
  </code></pre>
  <p>Everytime I get this error, my bot is offline from the stream (but still online on discord) and I have to restart the bot manually in order to reconnect to the stream. Is there a way to prevent this kind of error, and if not, to automatically restart the stream when it get errors?</p>
  <p>Thank you!</p>