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

feat: add deleteEmoji method to Server class #94

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/classes/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,12 @@
if (existing) return existing;

const member = await this.#collection.client.api.get(
`/servers/${this.id as ""}/members/${userId as ""}`

Check failure on line 583 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Argument of type '"/servers//members/"' is not assignable to parameter of type '"/auth/session/all" | "/" | "/admin/stats" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | ... 37 more ... | "-/webhooks/{webhook_id}"'.

Check failure on line 583 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Argument of type '"/servers//members/"' is not assignable to parameter of type '"/auth/session/all" | "/" | "/admin/stats" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | ... 37 more ... | "-/webhooks/{webhook_id}"'.
);

return this.#collection.client.serverMembers.getOrCreate(
member._id,

Check failure on line 587 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Property '_id' does not exist on type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...'.

Check failure on line 587 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Property '_id' does not exist on type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...'.
member

Check failure on line 588 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Argument of type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...' is not assignable to parameter of type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...'.

Check failure on line 588 in src/classes/Server.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Argument of type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...' is not assignable to parameter of type '{ _id: { server: string; user: string; }; joined_at: string; nickname?: string | null | undefined; avatar?: { _id: string; tag: string; filename: string; metadata: { type: "File"; } | { type: "Text"; } | { ...; } | { ...; } | { ...; }; ... 7 more ...; object_id?: string | ... 1 more ... | undefined; } | null | undef...'.
);
}

Expand Down Expand Up @@ -719,4 +719,14 @@
)
);
}

/**
* Delete emoji
* @param emojiId Emoji ID
*/
async deleteEmoji(emojiId: string) {
return await this.#collection.client.api.delete(
`/custom/emoji/${emojiId}`
);
}
}
Loading