andrewthederp / Disgames

A python module made to make creating games easier and adds a bunch of game commands to your discord python bot
Apache License 2.0
14 stars 3 forks source link

AttributeError: 'Games' object has no attribute '_session' #3

Closed Jerry-py closed 3 years ago

Jerry-py commented 3 years ago

What happened was at line 20: Line 20

What should be fixed is in my fork: Fork

Full error:

['Traceback (most recent call last):\n', '
File "C:\\Users\\pushe\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\disgames\\mixins\\madlib.py", line 31, in madlib\n    

json = await self.request(min, max)\n', '  

File "C:\\Users\\pushe\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\disgames\\mixins\\madlib.py", line 26, in request\n    

response = self.session.get(self.url, params=params)\n', '  

File "C:\\Users\\pushe\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\disgames\\mixins\\madlib.py", line 20, in session\n    

if not self._session:\n', 

"AttributeError: 'Games' object has no attribute '_session'\n", '\n

File"discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Games' object has no attribute '_session'\n"]
Jerry-py commented 3 years ago

Resolved in: https://github.com/andrewthederp/Disgames/commit/f437e26c487c82e84ecc76fa8fbaf1916d0ce5c7