feat: enhance kick functionality with specific user kick and integration
This commit is contained in:
12
core/cli.py
12
core/cli.py
@ -169,11 +169,23 @@ def reset_user(username: str):
|
||||
@click.option('--username', '-u', required=True, help='Username for the user to remove', type=str)
|
||||
def remove_user(username: str):
|
||||
try:
|
||||
cli_api.kick_user_by_name(username)
|
||||
cli_api.traffic_status()
|
||||
cli_api.remove_user(username)
|
||||
click.echo(f"User '{username}' removed successfully.")
|
||||
except Exception as e:
|
||||
click.echo(f'{e}', err=True)
|
||||
|
||||
@cli.command('kick-user')
|
||||
@click.option('--username', '-u', required=True, help='Username of the user to kick')
|
||||
def kick_user(username: str):
|
||||
"""Kicks a specific user by username."""
|
||||
try:
|
||||
cli_api.kick_user_by_name(username)
|
||||
click.echo(f"User '{username}' kicked successfully.")
|
||||
except Exception as e:
|
||||
click.echo(f'{e}', err=True)
|
||||
|
||||
|
||||
@cli.command('show-user-uri')
|
||||
@click.option('--username', '-u', required=True, help='Username for the user to show the URI', type=str)
|
||||
|
||||
Reference in New Issue
Block a user