I'm running the program on an Ubuntu system. But I had to customize the main.py because some paths are not recognized.
I also had to remove "pypiwin32" from the requirements file because it doesn't exist on Linux.
Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/discord/client.py", line 637, in _run_event
await coro(*args, **kwargs)
File "/root/KarutaSniper/main.py", line 130, in on_ready
await self.update_files()
File "/root/KarutaSniper/main.py", line 734, in update_files
with open("keywords\\characters.txt") as ff:
FileNotFoundError: [Errno 2] No such file or directory: 'keywords\\characters.txt'
async def update_files(self):
with open("keywords\\characters.txt") as ff:
self.chars = ff.read().splitlines()
with open("keywords\\animes.txt") as ff:
self.animes = ff.read().splitlines()
with open("keywords\\aniblacklist.txt") as ff:
self.aniblacklist = ff.read().splitlines()
with open("keywords\\charblacklist.txt") as ff:
self.charblacklist = ff.read().splitlines()
To
async def update_files(self):
with open(os.path.join("keywords", "characters.txt")) as ff:
self.chars = ff.read().splitlines()
with open(os.path.join("keywords", "animes.txt")) as ff:
self.animes = ff.read().splitlines()
with open(os.path.join("keywords", "aniblacklist.txt")) as ff:
self.aniblacklist = ff.read().splitlines()
with open(os.path.join("keywords", "charblacklist.txt")) as ff:
self.charblacklist = ff.read().splitlines()
I'm running the program on an Ubuntu system. But I had to customize the main.py because some paths are not recognized.
I also had to remove "pypiwin32" from the requirements file because it doesn't exist on Linux.
Error:
Fix: Changed lines are: 139-147 From
To
Fix: Changed lines are: 746-757 From
To
Other information: