Closed theAbdoSabbagh closed 2 years ago
Overriding Bot.__dict__
leads to a lot of issues.
@Sxvxgee You might want to setattr(class, name, value)
instead of bot.__dict__
.
bot = commands.Bot()
setattr(bot, 'test', 'foo')
print(bot.test) # equal to 'foo'
print(getattr(bot, test)) # 'foo'
Summary
For some reason when im importing my bot from it's file to
main.py
, I'm getting an error related to whatever event there is. If all events were removed, I get no error.Reproduction Steps
I'm really not sure if it has to do with anything with me import the bot from another file but just construct a bot and put some events, and import it from another file. That's what I did.
However, I think it's related to
bot.__dict__
, cuz I was using it.UPDATE: After some testing, it turns out it was because of
bot.__dict__
that it somehow raised an error forextra_events
and such. After removing all instances ofbot.__dict__
, I faced no issue.Code
No response
Expected Results
It should import the bot with no issues
Actual Results
System Information
doesnt work ._.worked thanks to #241Checklist
Additional Information
No response