original_docstring: Move everyone's grade level role up one.
docstring: Move everyone's grade level role up one.
docstring_tokens: Move everyone ' s grade level role up one .
code: async def new_grade(self, ctx: commands.Context) -> None:
          """Move everyone's grade level role up one."""
          log.info(f"Started role update at the request of {ctx.author}")
          # Make role IDs into objects for easier comparison:
          grade_5 = ctx.guild.get_role(CRoles.grade_5)
          grade_6 = ctx.guild.get_role(CRoles.grade_6)
          grade_7 = ctx.guild.get_role(CRoles.grade_7)
          grade_8 = ctx.guild.get_role(CRoles.grade_8)
  
          freshmen = ctx.guild.get_role(CRoles.freshmen)
          sophomores = ctx.guild.get_role(CRoles.sophomores)
          juniors = ctx.guild.get_role(CRoles.juniors)
          seniors = ctx.guild.get_role(CRoles.seniors)
          alumni = ctx.guild.get_role(CRoles.alumni)
          log.trace(f"Freshmen role: {freshmen}")
  
          for member in ctx.guild.members:
              if grade_5 in member.roles:
                  await self._update_class_role(member, grade_5, grade_6)
              elif grade_6 in member.roles:
                  await self._update_class_role(member, grade_6, grade_7)
              elif grade_7 in member.roles:
                  await self._update_class_role(member, grade_7, grade_8)
              elif grade_8 in member.roles:
                  await self._update_class_role(member, grade_8, freshmen)
              elif freshmen in member.roles:
                  await self._update_class_role(member, freshmen, sophomores)
              elif sophomores in member.roles:
                  await self._update_class_role(member, sophomores, juniors)
              elif juniors in member.roles:
                  await self._update_class_role(member, juniors, seniors)
              elif seniors in member.roles:
                  await member.remove_roles(seniors, reason="Class Roles update.")
                  await member.add_roles(alumni, reason="Class Roles update.")
                  # await member.send(
                  #     f"Your grade level role has been changed to {alumni.name}. "
                  #     + "Have fun in college!"
                  # )
                  log.trace(f"{member} has been moved from {seniors} to {alumni}")
              else:
                  log.trace(
                      f"{member} was either a bot or an alum, their class roles were "
                      + f"not changed. Their roles are: {member.roles}"
                  )
          log.info("Class roles update finished")
          await ctx.send("Updated all class roles!")
code_tokens: async def new_grade ( self , ctx : commands . Context ) -> None : log . info ( f"Started role update at the request of {ctx.author}" ) grade_5 = ctx . guild . get_role ( CRoles . grade_5 ) grade_6 = ctx . guild . get_role ( CRoles . grade_6 ) grade_7 = ctx . guild . get_role ( CRoles . grade_7 ) grade_8 = ctx . guild . get_role ( CRoles . grade_8 ) freshmen = ctx . guild . get_role ( CRoles . freshmen ) sophomores = ctx . guild . get_role ( CRoles . sophomores ) juniors = ctx . guild . get_role ( CRoles . juniors ) seniors = ctx . guild . get_role ( CRoles . seniors ) alumni = ctx . guild . get_role ( CRoles . alumni ) log . trace ( f"Freshmen role: {freshmen}" ) for member in ctx . guild . members : if grade_5 in member . roles : await self . _update_class_role ( member , grade_5 , grade_6 ) elif grade_6 in member . roles : await self . _update_class_role ( member , grade_6 , grade_7 ) elif grade_7 in member . roles : await self . _update_class_role ( member , grade_7 , grade_8 ) elif grade_8 in member . roles : await self . _update_class_role ( member , grade_8 , freshmen ) elif freshmen in member . roles : await self . _update_class_role ( member , freshmen , sophomores ) elif sophomores in member . roles : await self . _update_class_role ( member , sophomores , juniors ) elif juniors in member . roles : await self . _update_class_role ( member , juniors , seniors ) elif seniors in member . roles : await member . remove_roles ( seniors , reason = "Class Roles update." ) await member . add_roles ( alumni , reason = "Class Roles update." ) log . trace ( f"{member} has been moved from {seniors} to {alumni}" ) else : log . trace ( f"{member} was either a bot or an alum, their class roles were " + f"not changed. Their roles are: {member.roles}" ) log . info ( "Class roles update finished" ) await ctx . send ( "Updated all class roles!" )
short_docstring: Move everyone's grade level role up one.
short_docstring_tokens: Move everyone ' s grade level role up one .
comment: """Move everyone's grade level role up one."""$SEP$# Make role IDs into objects for easier comparison:$SEP$# await member.send($SEP$#     f"Your grade level role has been changed to {alumni.name}. "$SEP$#     + "Have fun in college!"$SEP$# )