GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 42-45 lines in 2 locations

axiol/plugins/moderation.py 2 locations

@@ 546-590 (lines=45) @@
543
                )
544
            )
545
546
    @commands.command(name="removerole")
547
    @has_command_permission()
548
    async def remove_role(
549
        self, ctx, member: discord.Member = None, role: discord.Role = None
550
    ):
551
        if member and role is not None:
552
            try:
553
                await member.remove_roles(role)
554
                await ctx.send(
555
                    embed=discord.Embed(
556
                        description=(
557
                            f"Successfully updated {member.mention} "
558
                            f"by removing {role.mention} role"
559
                        ),
560
                        color=var.C_GREEN
561
                    )
562
                )
563
564
            except discord.Forbidden:
565
                await ctx.send(
566
                    embed=discord.Embed(
567
                        title="Missing permissions",
568
                        description=(
569
                            f"I don't have permissions to update the roles of"
570
                            f" {member.mention}, either I don't have the"
571
                            f" permission or the member is above me"
572
                        ),
573
                        color=var.C_RED
574
                    )
575
                )
576
        else:
577
            await ctx.send(
578
                embed=discord.Embed(
579
                    title=f"🚫 Missing arguments",
580
                    description="You need to define both member and role",
581
                    color=var.C_RED
582
                ).add_field(
583
                    name="Format",
584
                    value=(
585
                        f"```{await get_prefix(ctx)}removerole"
586
                        f" <member> <role>```"
587
                    )
588
                ).set_footer(
589
                    text=(
590
                        "For both member and role,"
591
                        " either ping or ID can be used"
592
                    )
593
                )
@@ 499-540 (lines=42) @@
496
                )
497
            )
498
499
    @commands.command(aliases=["giverole"])
500
    @has_command_permission()
501
    async def addrole(
502
        self, ctx, member: discord.Member = None, role: discord.Role = None
503
    ):
504
        if member and role is not None:
505
            try:
506
                await member.add_roles(role)
507
                await ctx.send(
508
                    embed=discord.Embed(
509
                        description=(
510
                            f"Successfully updated {member.mention} "
511
                            f"with {role.mention} role"
512
                        ),
513
                        color=var.C_GREEN
514
                    )
515
                )
516
517
            except discord.Forbidden:
518
                await ctx.send(
519
                    embed=discord.Embed(
520
                        title="Missing permissions",
521
                        description=(
522
                            f"I don't have permissions to update the roles"
523
                            f" of {member.mention}, either I don't have the"
524
                            f" permission or the member is above me"
525
                        ),
526
                        color=var.C_RED
527
                    )
528
                )
529
        else:
530
            await ctx.send(
531
                embed=discord.Embed(
532
                    title=f"🚫 Missing arguments",
533
                    description="You need to define both member and role",
534
                    color=var.C_RED
535
                ).add_field(
536
                    name="Format",
537
                    value=f"```{await get_prefix(ctx)}addrole <member> <role>```"
538
                ).set_footer(
539
                    text=(
540
                        "For both member and role, "
541
                        "either ping or ID can be used"
542
                    )
543
                )