예제 #1
0
 async def off(self, ctx):
     """Unsubscribes you from contest reminders."""
     role = self._get_remind_role(ctx.guild)
     if role not in ctx.author.roles:
         embed = discord_common.embed_neutral(
             'You are not subscribed to contest reminders')
     else:
         await ctx.author.remove_roles(
             role, reason='User unsubscribed from contest reminders')
         embed = discord_common.embed_success(
             'Successfully unsubscribed from contest reminders')
     await ctx.send(embed=embed)
예제 #2
0
 async def _send_contest_list(self, ctx, contests, *, title, empty_msg):
     if contests is None:
         raise RemindersCogError('Contest list not present')
     if len(contests) == 0:
         await ctx.send(embed=discord_common.embed_neutral(empty_msg))
         return
     pages = self._make_contest_pages(
         contests, title, self.guild_map[ctx.guild.id].localtimezone)
     paginator.paginate(self.bot,
                        ctx.channel,
                        pages,
                        wait_time=_CONTEST_PAGINATE_WAIT_TIME,
                        set_pagenum_footers=True)
예제 #3
0
 async def on(self, ctx):
     """Subscribes you to contest reminders.
     Use 't;remind settings' to see the current settings.
     """
     role = self._get_remind_role(ctx.guild)
     if role in ctx.author.roles:
         embed = discord_common.embed_neutral(
             'You are already subscribed to contest reminders')
     else:
         await ctx.author.add_roles(
             role, reason='User subscribed to contest reminders')
         embed = discord_common.embed_success(
             'Successfully subscribed to contest reminders')
     await ctx.send(embed=embed)