Skip to content

Commit

Permalink
feat: added 'reason' property to ban manager (#247)
Browse files Browse the repository at this point in the history
* Update GuildBanManager.ts

added reason property

* Update packages/guilded.js/lib/managers/global/GuildBanManager.ts

* Create twelve-flowers-tease.md

* fix: types and linting

---------

Co-authored-by: Nico <[email protected]>
  • Loading branch information
ServerDeveloper9447 and zaida04 authored Mar 21, 2024
1 parent a12cb03 commit 410720d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twelve-flowers-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"guilded.js": patch
---

Added 'reason' property to ban manager
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion packages/guilded.js/lib/managers/global/GuildBanManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ export class GlobalGuildBanManager extends CacheableStructManager<string, Member
* @param userId The ID of the user.
* @returns A Promise that resolves with the newly created member ban.
*/
async ban(serverId: string, userId: string): Promise<MemberBan> {
async ban(serverId: string, userId: string, reason?: string): Promise<MemberBan> {
const data = await this.client.rest.router.memberBans.serverMemberBanCreate({
serverId,
userId,
requestBody: {
reason,
},
});
const newMemberBan = new MemberBan(this.client, {
serverId,
Expand Down

0 comments on commit 410720d

Please sign in to comment.