Example #1
0
 async def repost(self, ctx):
     guild = str(ctx.guild.id)
     channel_id = self.timers[guild]['settings']['timer_channel']
     timer_channel = self.bot.get_channel(int(channel_id))
     msg = await timer_channel.send("Timers go here")
     self.timers[guild]['settings']['timer_message'] = str(msg.id)
     f.save_json(timers_json, self.timers)
Example #2
0
 def __init__(self, bot):
     self.bot = bot
     self.timers = f.load_json(timers_json)
     for guild in self.bot.guilds:
         if str(guild.id) not in self.timers:
             self.timers[str(guild.id)] = {
                 'timers': {},
                 'settings': {
                     'timer_channel': None,
                     'timer_message': None
                 }
             }
     f.save_json(timers_json, self.timers)
     self.run_timers.start()
Example #3
0
 async def channel(self, ctx):
     guild = str(ctx.guild.id)
     msg = await ctx.send("Timers go here")
     self.timers[guild]['settings']['timer_channel'] = str(ctx.channel.id)
     self.timers[guild]['settings']['timer_message'] = str(msg.id)
     f.save_json(timers_json, self.timers)
Example #4
0
 async def remove(self, ctx, name):
     guild = str(ctx.guild.id)
     del self.timers[guild]['timers'][name]
     f.save_json(timers_json, self.timers)
Example #5
0
 async def create(self, ctx, name, *, time):
     guild = str(ctx.guild.id)
     self.timers[guild]['timers'][name] = {
         'set_time': parse_time(time.split())
     }
     f.save_json(timers_json, self.timers)