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

add Tag method to user #364

Merged
merged 3 commits into from
Apr 28, 2017
Merged

add Tag method to user #364

merged 3 commits into from
Apr 28, 2017

Conversation

ammario
Copy link
Contributor

@ammario ammario commented Apr 28, 2017

Simplifies process of tagging a user in messages

user.go Outdated

//Tag return a string which tags the user
func (u *User) Tag() string {
return fmt.Sprintf("<@%v>", u.ID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

%s for strings.

@iopred
Copy link
Collaborator

iopred commented Apr 28, 2017

Sorry to be a butt, there's a couple of things we should do here:

a) We should probably call this Mention()
b) We do string concatenation in String() above, we should be consistent here instead of formatting.

@iopred iopred merged commit e58e61b into bwmarrin:develop Apr 28, 2017
@ammario ammario deleted the add-user-tag branch April 28, 2017 19:30
@bwmarrin bwmarrin added this to the v0.16.0 milestone Apr 29, 2017
@diraven
Copy link

diraven commented May 20, 2017

It's still Sprintf, not concatenation.

@diraven
Copy link

diraven commented May 20, 2017

Also in https://github.com/bwmarrin/discordgo/releases it still says method name is "Tag".

ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
* add Tag method to user

* change format verb to %s

* use consistent string forming
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.

4 participants