0

I understand that if the bot access token expires we must get a new one from the refresh token and replace the token of my bot

bot = commands.Bot(
  token=token,
  client_id=os.environ[‘CLIENT_ID’],
  nick = “mynick”,
  prefix=“!”,
  initial_channels=[channel]
)

bot.run()

However I don’t understand how I can replace the token automatically when without stopping my server and manually changing the token every time the token expires.

Any help would be extremely appreciated thanks.

0 Answers0