Hello, I just opened one of my Discord Chat bots to make some changes, but clicking it did some upgrade to ‘Nix’.
Suddenly, my bot will no longer run as I keep getting the following error:
Traceback (most recent call last):
File "main.py", line 3, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
Which is simply the line:
import discord
It’s been a long time since I worked on these bots and don’t quite remember their set up.
Has something changed recently? Do I now need something new to work with Nix?
Yes! This is exactly why you get this error. In recent updates, discord made it so it can more efficiently send data by using intents (limit data to only what you need for your bot). Discord.py in a recent update also made changes to enforce this, so and code that is >1 year old will need to be changed to accommodate this.