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

Added .MessageFormat() to emoji struct #569

Merged
merged 3 commits into from
Jul 31, 2018
Merged

Conversation

ikkerens
Copy link
Contributor

.APIName currently covers all REST url cases, but with the introduction of animated Emoji the chat usage of Emoji has become slightly less obvious as well, despite bots being able to use them.

This new func makes usage of custom emoji (including animated ones) easier.

structs.go Outdated
@@ -281,6 +281,19 @@ type Emoji struct {
Animated bool `json:"animated"`
}

// ChatName returns a correctly formatted Emoji for use in Message content and embeds
func (e *Emoji) ChatName() string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MessageName ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I'd personally even be in favour of .String() or .Format or .MessageFormat.
Maybe the latter is the best?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MessageFormat SGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed change.

@ikkerens ikkerens changed the title Added .ChatName() to emoji struct Added .MessageFormat() to emoji struct Jul 31, 2018
@iopred iopred merged commit 1593c55 into bwmarrin:develop Jul 31, 2018
@ikkerens ikkerens deleted the patch-3 branch July 31, 2018 18:37
@bwmarrin bwmarrin added this to the v0.19.0 milestone Nov 2, 2018
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
* Added .ChatName() to emoji struct

* Renamed ChatName to MessageFormat

* Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants