Code Monkey home page Code Monkey logo

Comments (10)

corpnewt avatar corpnewt commented on September 28, 2024

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.

iDutchy avatar iDutchy commented on September 28, 2024

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.

corpnewt avatar corpnewt commented on September 28, 2024

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.

iDutchy avatar iDutchy commented on September 28, 2024

Thank you! I added the load_extension for the settings file before it loads all others and it works now! :D

from corpbot.py.

corpnewt avatar corpnewt commented on September 28, 2024

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.

iDutchy avatar iDutchy commented on September 28, 2024

Yea, I added the cog to my own bot... I did not download all of your files

from corpbot.py.

corpnewt avatar corpnewt commented on September 28, 2024

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.

iDutchy avatar iDutchy commented on September 28, 2024

Sorry, thanks for your help tho!

from corpbot.py.

corpnewt avatar corpnewt commented on September 28, 2024

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.

iDutchy avatar iDutchy commented on September 28, 2024

Will make sure to do that! :)

from corpbot.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.