types(UserManager): fix send() return type to Promise<Message<false>> (#11337)

* types(UserManager): fix send() return type to Promise<Message<false>>

UserManager.send() always sends a direct message (DM), so the return type should b Promise<Message<false>> instead of Promise<Message> to correctly indicate that the message is not in a guild context.

Closes #11331

* fix: requested changes

---------

Co-authored-by: almeidx <github@almeidx.dev>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Aryan Bagade
2026-07-14 21:20:38 +01:00
committed by Jiralite
co-authored by almeidx Jiralite
parent 74a42bfd10
commit 07c412791d
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -5426,7 +5426,7 @@ export class UserManager extends CachedManager<Snowflake, User, UserResolvable>
public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise<User>;
/** @deprecated This method is deprecated and will be removed in the next major version. Flags may still be retrieved via {@link UserManager.fetch} */
public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise<UserFlagsBitField>;
public send(user: UserResolvable, options: string | MessagePayload | MessageCreateOptions): Promise<Message>;
public send(user: UserResolvable, options: string | MessagePayload | MessageCreateOptions): Promise<Message<false>>;
}
export class VoiceStateManager extends CachedManager<Snowflake, VoiceState, typeof VoiceState> {
@@ -1517,6 +1517,8 @@ expectType<TextBasedChannelFields<true>['send']>(voiceChannel.send);
expectAssignable<PartialTextBasedChannelFields>(user);
expectAssignable<PartialTextBasedChannelFields>(guildMember);
expectType<Promise<Message<false>>>(client.users.send(user, 'test'));
expectType<Promise<NewsChannel>>(textChannel.setType(ChannelType.GuildAnnouncement));
expectType<Promise<TextChannel>>(newsChannel.setType(ChannelType.GuildText));