File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Context } from "grammy" ;
22import { MESSAGE } from "../../helper/message" ;
33import { Permissions } from "./Permissions" ;
4- import { GroupMembershipService } from "../db/group/Membership" ;
54export 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 */
You can’t perform that action at this time.
0 commit comments