-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat!: add ChannelManager#createMessage()
#10559
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing an implementation in send()
. Just like reply
is an option there, there should be a forward
option.
Although, now that both reply
and forward
is there, maybe both should be removed in favour of messageReference
so we don't have to keep adding new message reference types (and thus new properties).
a55e642
to
1156836
Compare
7ae23ed
to
6f08f65
Compare
6f08f65
to
afbbc7d
Compare
715fdbe
to
bf2ac31
Compare
ChannelManager#createMessage()
async send(user, options) { | ||
return (await this.createDM(user)).send(options); | ||
const dmChannel = await this.createDM(user); | ||
|
||
return this.client.channels.createMessage(dmChannel, options); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed, as it is now located on the more-appropriate channel manager? It only came into existence to allow sending messages to uncached users: #7087
This isn't an actual API route for users, so I would like to say removing this here makes sense. Thoughts, @vladfrangu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a huge fan of client.channels.createMessage
, but not a fan of removing TextBasedChannel#send
/ Message#reply
. Let's please keep those in and redirect to the manager function
bf2ac31
to
6625b32
Compare
6625b32
to
a320a45
Compare
* @param {string|MessagePayload|MessageCreateOptions} options The options to provide | ||
* @returns {Promise<Message>} | ||
*/ | ||
async send(user, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm...torn, it doesn't hurt to have this but I understand why we'd also remove it. 🤷
@discordjs/core do we keep it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a method for users. It should still be on the guild member and user class as a helper, though.
Please describe the changes this PR makes and why it should be merged:
Adds a centralized spot where the creation of messages go through.
BREAKING CHANGE:
MessageCreateOptions
no longer acceptsreply
. UsemessageReference
instead.BREAKING CHANGE:
UserManager#send()
no longer exists. UseChannelManager#createMessage()
instead.Status and versioning classification: