Reverting back to old way of doing cogs

pull/8/head
sgoudham 4 years ago
parent 27945c49eb
commit 97a5ff44a0

@ -536,3 +536,11 @@ class Bot(commands.Bot):
self.run(API_TOKEN)
except discord.errors.LoginFailure as e:
print(e, "Login unsuccessful.")
# Returns a list of all the cogs
def extensions(self):
ext = ['cogs.interactive', 'cogs.anime', 'cogs.relationship',
'cogs.help', 'cogs.info', 'cogs.guild', 'cogs.fun', "cogs.error",
'cogs.enso', 'cogs.owner', 'cogs.moderation']
return ext

@ -16,16 +16,14 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Initiating Bot Object As Client
from glob import glob
from bot.__init__ import Bot
client = Bot()
if __name__ == "__main__":
cogs = [path.split("\\")[-1][:-3] for path in glob("./cogs/*.py")]
for ext in cogs:
client.load_extension(f"cogs.{ext}")
if __name__ == '__main__':
for ext in client.extensions():
client.load_extension(ext)
# Run the bot
client.run_bot()

Loading…
Cancel
Save