async def toggletracking(self, ctx): """Toggle light tracking of data.""" self.bot.track = not self.bot.track write_config_value("config", "track", self.bot.track) await ctx.send( self.bot.bot_prefix + "Successfully set tracking to {}.".format(self.bot.track))
async def cmdprefix(self, ctx, *, msg): """Set your command prefix for normal commands. Requires a reboot.""" write_config_value("config", "cmd_prefix", msg) await ctx.send( self.bot.bot_prefix + 'Prefix changed. Use `restart` to reboot the bot for the updated prefix.' )
async def font(self, ctx, *, txt: str): """Change font for ascii. All fonts: http://www.figlet.org/examples.html for all fonts.""" try: str(figlet_format('test', font=txt)) except: return await ctx.send(self.bot.bot_prefix + 'Invalid font type.') write_config_value("optional_config", "ascii_font", txt) await ctx.send(self.bot.bot_prefix + 'Successfully set ascii font.')
async def font(self, ctx, *, txt: str): """Change font for ascii. All fonts: http://www.figlet.org/examples.html for all fonts.""" try: str(figlet_format('test', font=txt)) except (FontError, FontNotFound): return await ctx.send(self.bot.bot_prefix + 'Invalid font type.') write_config_value("optional_config", "ascii_font", txt) await ctx.send(self.bot.bot_prefix + 'Successfully set ascii font.')
async def botprefix(self, ctx, *, msg): """Set bot prefix""" if not botmaster_perms(ctx.message): await ctx.send(self.bot.bot_prefix + 'You are not allowed to do that.') return write_config_value("config", "bot_identifier", msg) self.bot.bot_prefix = msg + ' ' await ctx.send(self.bot.bot_prefix + 'Prefix changed.')
async def customcmdprefix(self, ctx, *, msg): """Set your command prefix for custom commands.""" if not botmaster_perms(ctx.message): await ctx.send(self.bot.bot_prefix + 'You are not allowed to do that.') return write_config_value("config", "customcmd_prefix", msg) self.bot.customcmd_prefix = msg await ctx.send(self.bot.bot_prefix + 'Prefix changed.')
async def timezone(self, ctx, *, msg): """Set preferred timezone. Use the timezonelist for a full list of timezones.""" if not botmaster_perms(ctx.message): await ctx.send(self.bot.bot_prefix + 'You are not allowed to do that.') return write_config_value("optional_config", "timezone", msg) await ctx.send(self.bot.bot_prefix + 'Preferred timezone has been set.')
async def cmdprefix(self, ctx, *, msg): """Set your command prefix for normal commands. Requires a reboot.""" if not botmaster_perms(ctx.message): await ctx.send(self.bot.bot_prefix + 'You are not allowed to do that.') return write_config_value("config", "cmd_prefix", msg) await ctx.send( self.bot.bot_prefix + 'Prefix changed. Use `restart` to reboot the bot for the updated prefix.' )
async def toggletime(self, ctx): """Toggle between 24 hours time and 12 hours time""" opt = dataIO.load_json('settings/optional_config.json') try: if opt['24hours'] == "true": write_config_value("optional_config", "24hours", "false") await ctx.send(self.bot.bot_prefix + "Set time to `12 hour` clock") else: write_config_value("optional_config", "24hours", "true") await ctx.send(self.bot.bot_prefix + "Set time to `24 hour` clock") except: # Nothing was set, so changing the default to 12hrs write_config_value("optional_config", "24hours", "false") await ctx.send(self.bot.bot_prefix + "Set time to `12 hour` clock")
async def botprefix(self, ctx, *, msg): """Set bot prefix""" write_config_value("config", "bot_identifier", msg) self.bot.bot_prefix = msg + ' ' await ctx.send(self.bot.bot_prefix + 'Prefix changed.')
async def customcmdprefix(self, ctx, *, msg): """Set your command prefix for custom commands.""" write_config_value("config", "customcmd_prefix", msg) self.bot.customcmd_prefix = msg await ctx.send(self.bot.bot_prefix + 'Prefix changed.')
async def timezone(self, ctx, *, msg): """Set preferred timezone. Use the timezonelist for a full list of timezones.""" write_config_value("optional_config", "timezone", msg) await ctx.send(self.bot.bot_prefix + 'Preferred timezone has been set.')
async def cmdprefix(self, ctx, *, msg): """Set your command prefix for normal commands. Requires a reboot.""" write_config_value("config", "cmd_prefix", msg) await ctx.send(self.bot.bot_prefix + 'Prefix changed. Use `restart` to reboot the bot for the updated prefix.')