-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add emoji string support for select menu options
- Loading branch information
1 parent
4f7cab1
commit 28b4c92
Showing
4 changed files
with
34 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const { SelectMenuOption: BuildersSelectMenuOption } = require('@discordjs/builders'); | ||
const Util = require('../util/Util'); | ||
|
||
class SelectMenuOption extends BuildersSelectMenuOption { | ||
/** | ||
* Sets the emoji to display on this option | ||
* @param {APIMessageComponentEmoji} emoji The emoji to display on this option | ||
* @returns {SelectMenuOption} | ||
*/ | ||
setEmoji(emoji) { | ||
if (typeof emoji === 'string') { | ||
return super.setEmoji(Util.parseEmoji(emoji)); | ||
} | ||
return super.setEmoji(emoji); | ||
} | ||
} | ||
|
||
module.exports = SelectMenuOption; |
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