Пример #1
0
 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))
Пример #2
0
 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.'
     )
Пример #3
0
 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.')
Пример #4
0
 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.')
Пример #5
0
 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.')
Пример #6
0
 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.')
Пример #7
0
 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.')
Пример #8
0
 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.'
     )
Пример #9
0
 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")
Пример #10
0
 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")
Пример #11
0
 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.')
Пример #12
0
 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.')
Пример #13
0
 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.')
Пример #14
0
 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.')
Пример #15
0
 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.')
Пример #16
0
 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.')
Пример #17
0
 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.')