log("err",'Error no token is present type: export MEETOO_TOKEN="[Your token here]" into your terminall NOW!')
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()
start_time=time.time()
@ -55,6 +55,7 @@ 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..
#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:
classAPI:
#Returns config.tomls content in a array.
#Returns config.tomls content in a array.
@ -63,7 +64,7 @@ class API:
#Dumps all the toml data from self.config and stores it inside toml.config
#Dumps all the toml data from self.config and stores it inside toml.config
defsave_config(self):
defsave_config(self):
try:
try:
withopen("config.toml","w")asf:
withopen("config.toml",w)asf:
self.log("inf","Saving the configuration file...")
self.log("inf","Saving the configuration file...")
toml.dump(self.config,f)
toml.dump(self.config,f)
self.log("inf","Config was saved to config.toml")
self.log("inf","Config was saved to config.toml")
@ -93,8 +94,6 @@ class API:
self.token=token
self.token=token
self.guild_ids=config["bot"]["guild_ids"]
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..
#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:
classCLI:
@ -215,7 +214,6 @@ async def stop(ctx):
if__name__=="__main__":
if__name__=="__main__":
api=API(config,bot,log,token)
api=API(config,bot,log,token)
cli=CLI(api)
cli=CLI(api)
bot.api=api
bot.api=api
@ -315,6 +313,20 @@ if __name__ == "__main__":
cli.register_command("unload",cli_unload,"Unloads a cog takes a cog name as a arg example: unload cogs.example")
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.")