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

REST API: support Application emojis #1567

Open
Big-Iron-Cheems opened this issue Sep 10, 2024 · 0 comments
Open

REST API: support Application emojis #1567

Big-Iron-Cheems opened this issue Sep 10, 2024 · 0 comments

Comments

@Big-Iron-Cheems
Copy link
Contributor

As of now, discordgo's restapi.go supports control of Guild based emojis, but not Application based ones.
The docs related to Guild and Application emojis are located here: https://discord.com/developers/docs/resources/emoji.
I am interested in supporting all the endpoints that begin with /applications/.

Screenshot below is from the https://discord.com/developers/applications/APPLICATION_ID/emojis page.
image

Currently I have written this function in my personal project to GET a specific emoji by ID:

// applicationEmoji fetches an emoji from the application
func applicationEmoji(s *discordgo.Session, applicationID string, emojiID string, options ...discordgo.RequestOption) (emoji *discordgo.Emoji, err error) {
	var body []byte
	body, err = s.RequestWithBucketID("GET", discordgo.EndpointApplication(applicationID)+"/emojis/"+emojiID, nil, discordgo.EndpointApplication(applicationID), options...)
	if err != nil {
		return
	}

	err = discordgo.Unmarshal(body, &emoji)
	return
}

// Example usage in my project
emoji, err = applicationEmoji(s, applicationID, emojiID)

I am working on an implementation that is close to the Guild emoji functions.
Progress tracked at this PR, suggestions appreciated.

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

No branches or pull requests

1 participant