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

refactor!: return void on bans/kick/addRole/removeRole methods #10714

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

almeidx
Copy link
Member

@almeidx almeidx commented Jan 19, 2025

BREAKING CHANGE: The following methods now always return the user's id: GuildMember#ban, GuildMember#kick, GuildMemberManager#ban, GuildMemberManager#unban, GuildMemberManager#kick, GuildMemberManager#addRole, GuildMemberManager#removeRole, GuildBanManager#create, and GuildBanManager#remove.

Previously, these methods tried to return a cached user or member object, but this was unreliable and required callers to handle varying return types.

If the caller needs user or member data, they can fetch or retrieve it from the cache before invoking these methods.

Copy link

vercel bot commented Jan 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 10:19am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 10:19am

BREAKING CHANGE: The following methods don't return anything: `GuildMember#ban`, `GuildMember#kick`, `GuildMemberManager#ban`, `GuildMemberManager#unban`, `GuildMemberManager#kick`, `GuildMemberManager#addRole`, `GuildMemberManager#removeRole`, `GuildBanManager#create`, and `GuildBanManager#remove`.
@almeidx almeidx force-pushed the refactor/bans-return-user-id branch from 9c78ff4 to e2a2f30 Compare January 19, 2025 19:03
@almeidx almeidx changed the title refactor!: return user id instead of resolving member/user refactor!: return void on bans/kick/addRole/removeRole methods Jan 19, 2025
@almeidx almeidx requested a review from Jiralite January 19, 2025 19:04
@almeidx almeidx merged commit 8e3ab32 into main Jan 24, 2025
8 checks passed
@almeidx almeidx deleted the refactor/bans-return-user-id branch January 24, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants