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

Make FetchMessage work for non-bot users #1291

Merged
merged 8 commits into from
Mar 21, 2017
Merged

Make FetchMessage work for non-bot users #1291

merged 8 commits into from
Mar 21, 2017

Conversation

PgBiel
Copy link
Contributor

@PgBiel PgBiel commented Mar 19, 2017

Basically just a shortcut to fetchMessages({ limit: 1, around: ID }), but it can be useful in case e.g. someone transfers their bot to an user account, or even be useful as a shortcut itself.

@rei2hu
Copy link
Contributor

rei2hu commented Mar 20, 2017

This is going to make fetchMessage return a collection for user accounts but not bot accounts, also it will return a random message for user accounts if the message doesn't exist while bot accounts get an unknown message error.

@devsnek
Copy link
Member

devsnek commented Mar 20, 2017

this isn't consistant, you should map the return collection to the single message as expected

@devsnek
Copy link
Member

devsnek commented Mar 20, 2017

if (!this.client.user.bot) return this.fetchMessages({ limit: 1, around: messageID }).then(c => c.first())

@Gawdl3y Gawdl3y merged commit 64ce829 into discordjs:master Mar 21, 2017
@PgBiel PgBiel deleted the patch-1 branch March 24, 2017 15:46
devsnek pushed a commit to devsnek/discord.js that referenced this pull request May 14, 2017
* [WIP] make fetchMessage work for normal users

wip

* Actual thing

* not WIP anymore

better docs

* oops

* better stuff

* Update TextBasedChannel.js

* Update TextBasedChannel.js

* Update TextBasedChannel.js
devsnek pushed a commit to devsnek/discord.js that referenced this pull request May 14, 2017
* [WIP] make fetchMessage work for normal users

wip

* Actual thing

* not WIP anymore

better docs

* oops

* better stuff

* Update TextBasedChannel.js

* Update TextBasedChannel.js

* Update TextBasedChannel.js
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.

None yet

5 participants