forked from discordjs/discord.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
UserContextMenuInteraction
and `MessageContextMenuInterac…
…tion` (discordjs#7003) Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: GrapeColor <grapecolor@users.noreply.github.com>
- Loading branch information
1 parent
a39d8c4
commit 4fe063f
Showing
6 changed files
with
90 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
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,20 @@ | ||
'use strict'; | ||
|
||
const ContextMenuInteraction = require('./ContextMenuInteraction'); | ||
|
||
/** | ||
* Represents a message context menu interaction. | ||
* @extends {ContextMenuInteraction} | ||
*/ | ||
class MessageContextMenuInteraction extends ContextMenuInteraction { | ||
/** | ||
* The message this interaction was sent from | ||
* @type {Message|APIMessage} | ||
* @readonly | ||
*/ | ||
get targetMessage() { | ||
return this.options.getMessage('message'); | ||
} | ||
} | ||
|
||
module.exports = MessageContextMenuInteraction; |
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,29 @@ | ||
'use strict'; | ||
|
||
const ContextMenuInteraction = require('./ContextMenuInteraction'); | ||
|
||
/** | ||
* Represents a user context menu interaction. | ||
* @extends {ContextMenuInteraction} | ||
*/ | ||
class UserContextMenuInteraction extends ContextMenuInteraction { | ||
/** | ||
* The user this interaction was sent from | ||
* @type {User} | ||
* @readonly | ||
*/ | ||
get targetUser() { | ||
return this.options.getUser('user'); | ||
} | ||
|
||
/** | ||
* The member this interaction was sent from | ||
* @type {?(GuildMember|APIGuildMember)} | ||
* @readonly | ||
*/ | ||
get targetMember() { | ||
return this.options.getMember('user'); | ||
} | ||
} | ||
|
||
module.exports = UserContextMenuInteraction; |
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