Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHAT] Delete message #326

Open
brayanrojasweb opened this issue Aug 9, 2020 · 1 comment
Open

[CHAT] Delete message #326

brayanrojasweb opened this issue Aug 9, 2020 · 1 comment
Assignees
Labels
chat Issues related to chat In Progress Work has begun on this issue

Comments

@brayanrojasweb
Copy link

It would be a good option to delete a message in the chat, but there is no option to delete, please add an option.

@DispatchCommit
Copy link
Collaborator

DispatchCommit commented Aug 16, 2020

For documentation purposes:

There does exist partial support for this that could be expanded.

interface IDeleteData {
  ids: string[],
}

async onDelete ( socket: socketio.Socket, data: IDeleteData ) {
  // Check if admin
  if ( !verifyAdmin( socket) ) return;

  // Verify we need to actually do something
  if ( !(data.ids?.length > 0) ) return;

  // Log command usage
  logger.adminCommand( `${getSocketUsername( socket)} Deleted:`, data );

  // Remove message
  await chat.deleteMessage( data.ids );
}

@DispatchCommit DispatchCommit added the chat Issues related to chat label Aug 16, 2020
@DispatchCommit DispatchCommit self-assigned this Aug 16, 2020
@DispatchCommit DispatchCommit added the In Progress Work has begun on this issue label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat Issues related to chat In Progress Work has begun on this issue
Projects
None yet
Development

No branches or pull requests

2 participants