Comments (10)
Make sure you've updated your instance of the bot - the Settings.py file was updated to include the getServerStat() function in the rewrite branch a few weeks ago. Shutting the bot down fully then restarting it may also help.
I just looked through my commits - I was thinking of the [get|set|del]GlobalStat() functions added here.
I keep getting an error that it couldn't get getServerStat. I do have the get_cog in my init
Can you send the error? That function has been implemented in the Settings.py module for a long time at this point, and shouldn't be causing issues.
-CorpNewt
from corpbot.py.
File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 62, in wrapped ret = await coro(*args, **kwargs) File "/usr/bin/CharlesBot/cogs/TempRole.py", line 406, in addtemprole if self.settings.getServerStat(ctx.message.guild, "SuppressMentions"): AttributeError: 'NoneType' object has no attribute 'getServerStat'
from corpbot.py.
Looks like your Settings module is not loaded. When the TempRole module is loaded, it stores a reference to the Settings instance here. With your error, it appears that the Settings module is either absent or fails to initialize. Per the CogManager, the Settings module is always instantiated prior to other modules via the following code snippet:
def _load_extension(self, extension = None):
# Loads extensions - if no extension passed, loads all
# starts with Settings, then Mute
if extension == None:
# Load them all!
self.bot.load_extension("Cogs.Settings")
That code is initially called here - and while the CogManager appears to load without a reference to the Settings module - when the _load_extensions()
function is called, it loads Settings and Mute first, then reloads the rest (CogManager included) - so it's only without the reference for a short period of time.
My best guess is that your bot is either missing files, or something has been changed.
-CorpNewt
from corpbot.py.
Thank you! I added the load_extension for the settings file before it loads all others and it works now! :D
from corpbot.py.
What? If you're working on a fork of the bot, this was never an issue with my copy anyway... My code already has the _load_extensions()
function called appropriately.
-CorpNewt
from corpbot.py.
Yea, I added the cog to my own bot... I did not download all of your files
from corpbot.py.
In the future that is necessary information for troubleshooting - and it is not an issue with my bot, so the issue does not belong here.
-CorpNewt
from corpbot.py.
Sorry, thanks for your help tho!
from corpbot.py.
No problem, best of luck with your bot - if you use modules from mine, do make sure to credit me for what I've written.
-CorpNewt
from corpbot.py.
Will make sure to do that! :)
from corpbot.py.
Related Issues (20)
- How to use MongoDB? HOT 2
- Claiming the Bot HOT 4
- Need links HOT 2
- Cogs HOT 1
- a very weird issue HOT 2
- Can not be owner. HOT 1
- API Key HOT 2
- 3 cogs not loading
- Help? HOT 21
- Chatterbot cog is not loading
- Resetting Bot Presence HOT 1
- Conform to PEP 8 HOT 3
- discord.py no longer updated HOT 2
- Lavalink Error HOT 4
- Updated not but errors no matter what HOT 7
- TypeError: object NoneType can't be used in 'await' expression HOT 1
- Code readability HOT 2
- 'NoneType' object has no attribute HOT 21
- Any way to edit the standard.brn file HOT 1
- PCPP Command HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corpbot.py.