Skip to content

Commit 6795cef

Browse files
Add delete-all strikes command
1 parent c265d58 commit 6795cef

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

cogs/delete_all.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
import discord
66

7-
from db.core.models import AssignedCommitteeAction, DiscordReminder, GroupMadeMember
7+
from db.core.models import (
8+
AssignedCommitteeAction,
9+
DiscordMemberStrikes,
10+
DiscordReminder,
11+
GroupMadeMember,
12+
)
813
from utils import CommandChecks, TeXBotBaseCog
914

1015
if TYPE_CHECKING:
@@ -88,3 +93,18 @@ async def delete_all_actions(self, ctx: "TeXBotApplicationContext") -> None:
8893
to delete all `Action` instance objects stored in the database.
8994
"""
9095
await self._delete_all(ctx, delete_model=AssignedCommitteeAction)
96+
97+
@delete_all.command(
98+
name="strikes",
99+
description="Deletes all the Strikes from the backend database.",
100+
)
101+
@CommandChecks.check_interaction_user_has_committee_role
102+
@CommandChecks.check_interaction_user_in_main_guild
103+
async def delete_all_strikes(self, ctx: "TeXBotApplicationContext") -> None:
104+
"""
105+
Definition & callback response of the "delete-all-strikes" command.
106+
107+
The "delete-all-strikes" command uses the _delete_all() function
108+
to delete all `Strike` instance objects stored in the database.
109+
"""
110+
await self._delete_all(ctx, delete_model=DiscordMemberStrikes)

0 commit comments

Comments
 (0)