Code Duplication    Length = 19-19 lines in 3 locations

app/cogs/workers.py 1 location

@@ 116-134 (lines=19) @@
113
        await self.manager.wipe()
114
        await ctx.send("> Wiped!")
115
116
    @commands.command(
117
        name="desc-3",
118
        description="Met à jour la description de la liste de travail."
119
    )
120
    @commands.has_any_role(SALARIED_ROLE_ID, PDG_ROLE_ID)
121
    async def set_drink_list_description(self, ctx, *, message):
122
        await ctx.message.delete()
123
124
        with open(
125
            "assets/worklist_description.txt",
126
            'w', encoding='utf-8'
127
        ) as f:
128
            f.write(message)
129
130
        await ctx.send(
131
            f"Description mise à jour\n>>> {message}", delete_after=5
132
        )
133
134
        await self.manager.update()
135
136
    @commands.command(name="pay")
137
    @commands.has_any_role(SALARIED_ROLE_ID, PDG_ROLE_ID)

app/cogs/members.py 1 location

@@ 74-92 (lines=19) @@
71
        await self.manager.remove(company_name, 'company')
72
        await ctx.send('Retiré!', delete_after=2)
73
74
    @commands.command(
75
        name="desc-2",
76
        description="Met à jour la description de la liste des adherents."
77
    )
78
    @commands.has_any_role(SALARIED_ROLE_ID, PDG_ROLE_ID)
79
    async def set_drink_list_description(self, ctx: Context, *, message: str):
80
        await ctx.message.delete()
81
82
        with open(
83
            "assets/members_description.txt",
84
            'w', encoding='utf-8'
85
        ) as f:
86
            f.write(message)
87
88
        await ctx.send(
89
            f"Description mise à jour\n>>> {message}", delete_after=5
90
        )
91
92
        await self.manager.update()
93
94
    @commands.Cog.listener()
95
    async def on_command_error(self, ctx: Context, exc: CommandError):

app/cogs/tickets.py 1 location

@@ 65-83 (lines=19) @@
62
        await self.pot.remove(amount)
63
        await ctx.send("> Retiré", delete_after=3)
64
65
    @commands.command(
66
        name="desc-4",
67
        description="Met à jour la description de la cagnotte."
68
    )
69
    @commands.has_any_role(SALARIED_ROLE_ID, PDG_ROLE_ID)
70
    async def set_drink_list_description(self, ctx: Context, *, message: str):
71
        await ctx.message.delete()
72
73
        with open(
74
            "assets/pot_description.txt",
75
            'w', encoding='utf-8'
76
        ) as f:
77
            f.write(message)
78
79
        await ctx.send(
80
            f"Description mise à jour\n>>> {message}", delete_after=5
81
        )
82
83
        await self.pot.update()
84
85
86
def setup(client) -> NoReturn: