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-01-02 09:56:34 -08:00
committed by GitHub
parent c921e84531
commit 8ccae833e7
2 changed files with 3 additions and 1 deletions

View File

@@ -4801,7 +4801,7 @@ export class UserManager extends CachedManager<Snowflake, User, UserResolvable>
public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise<DMChannel>;
public deleteDM(user: UserResolvable): Promise<DMChannel>;
public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise<User>;
public send(user: UserResolvable, options: MessageCreateOptions | MessagePayload | string): Promise<Message>;
public send(user: UserResolvable, options: MessageCreateOptions | MessagePayload | string): Promise<Message<false>>;
}
export class VoiceStateManager extends CachedManager<Snowflake, VoiceState, typeof VoiceState> {

View File

@@ -1534,6 +1534,8 @@ expectType<SendMethod<true>['send']>(voiceChannel.send);
expectAssignable<SendMethod>(user);
expectAssignable<SendMethod>(guildMember);
expectType<Promise<Message<false>>>(client.users.send(user, 'test'));
expectType<Promise<AnnouncementChannel>>(textChannel.setType(ChannelType.GuildAnnouncement));
expectType<Promise<TextChannel>>(announcementChannel.setType(ChannelType.GuildText));