log("err",'Error no token is present type: export MEETOO_TOKEN="[Your token here]" into your terminall NOW!')
log("dbg",f"Token is: {token}")
start_time=time.time()
@ -55,7 +55,6 @@ logger.debug("Loaded the client.")
#Api used mainly for plugins so getting uptime, loading, unloading, reloading plugins, getting status of plugins, get plugin info, stopping the bot, getting bot name and tag, getting cpm/commands per minute, get if there is web plugin, if there is web plugin register api, get if plugin supports web and so on..
classAPI:
#Returns config.tomls content in a array.
@ -64,7 +63,7 @@ class API:
#Dumps all the toml data from self.config and stores it inside toml.config
defsave_config(self):
try:
withopen("config.toml",w)asf:
withopen("config.toml","w")asf:
self.log("inf","Saving the configuration file...")
toml.dump(self.config,f)
self.log("inf","Config was saved to config.toml")
@ -94,6 +93,8 @@ class API:
self.token=token
self.guild_ids=config["bot"]["guild_ids"]
#This is the most basic interface CLI wich is basically a comand line that appears when you launch the app it will have commands like stop, help, commands, cogs, load, unload and so on..
classCLI:
@ -214,6 +215,7 @@ async def stop(ctx):
if__name__=="__main__":
api=API(config,bot,log,token)
cli=CLI(api)
bot.api=api
@ -313,20 +315,6 @@ if __name__ == "__main__":
cli.register_command("unload",cli_unload,"Unloads a cog takes a cog name as a arg example: unload cogs.example")
#start Starts the bot itself.
defcli_start(self):
print("Starting the bot...")
try:
self.api.bot.run(self.api.token)
exceptExceptionase:
print(e)
return1
else:
print("Bot started.")
return0
#cli.register_command("start", cli_start, "Starts the bot.")