Skip to content

Commit 370bbbe

Browse files
committed
style(service/command): remove comment and groupmembership import
1 parent 92bbeb8 commit 370bbbe

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

src/service/command/ban.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Context } from "grammy";
22
import { MESSAGE } from "../../helper/message";
33
import { Permissions } from "./Permissions";
4-
import { GroupMembershipService } from "../db/group/Membership";
54
export class BanService {
65
private ctx: Context;
76
private userId: number;
@@ -15,14 +14,10 @@ export class BanService {
1514
* Bans a user from the chat.
1615
*/
1716
async ban(reply: boolean = true) {
18-
// Step 1: Lift any existing restrictions (mute, restrict, etc.)
1917
await this.resetUser();
2018

21-
// Step 2: Ban the user
2219
await this.ctx.api.banChatMember(this.ctx.chat?.id!, this.userId);
2320

24-
// Step 3: Delete user data from the database
25-
await this.deleteUserData();
2621
if (!reply) {
2722
return MESSAGE.BAN_USE_BLACKLIST_MSG(this.ctx.message?.from!);
2823
}
@@ -37,12 +32,6 @@ export class BanService {
3732
await this.ctx.restrictChatMember(this.userId, Permissions.DEFAULT);
3833
}
3934

40-
/**
41-
* Deletes the user's data from the database.
42-
*/
43-
private async deleteUserData() {
44-
await new GroupMembershipService().deleteUser(this.userId);
45-
}
4635
/**
4736
* Unbans a user from the chat.
4837
*/

0 commit comments

Comments
 (0)