-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core[minor]: Add RemoveMessage class (#6089)
* core[minor]: Add RemoveMessage class * add comment
- Loading branch information
1 parent
33c359b
commit 7bad0f8
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { BaseMessage, BaseMessageFields, MessageType } from "./base.js"; | ||
|
||
export interface RemoveMessageFields | ||
extends Omit<BaseMessageFields, "content"> { | ||
/** | ||
* The ID of the message to remove. | ||
*/ | ||
id: string; | ||
} | ||
|
||
/** | ||
* Message responsible for deleting other messages. | ||
*/ | ||
export class RemoveMessage extends BaseMessage { | ||
/** | ||
* The ID of the message to remove. | ||
*/ | ||
id: string; | ||
|
||
constructor(fields: RemoveMessageFields) { | ||
super({ | ||
...fields, | ||
content: "", | ||
}); | ||
this.id = fields.id; | ||
} | ||
|
||
_getType(): MessageType { | ||
return "remove"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters