-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix buttons with custom emojis if no emojis are configured
- Loading branch information
1 parent
e685b0f
commit 1864933
Showing
6 changed files
with
79 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
import {ButtonBuilder} from 'discord.js'; | ||
|
||
export default class BetterButtonBuilder extends ButtonBuilder { | ||
/** | ||
* Set the emoji for this button. | ||
* If the emoji parameter is null, don't change the emoji. | ||
* | ||
* @param {?import('discord.js').ComponentEmojiResolvable} emoji | ||
* @return {ButtonBuilder|BetterButtonBuilder} | ||
*/ | ||
setEmojiIfPresent(emoji) { | ||
if (!emoji) { | ||
return this; | ||
} | ||
|
||
return super.setEmoji(emoji); | ||
} | ||
} |
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