-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathBan.ts
More file actions
26 lines (24 loc) · 811 Bytes
/
Ban.ts
File metadata and controls
26 lines (24 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import type { APIBan } from 'discord-api-types/v10';
import { Structure } from '../Structure';
import { kData } from '../utils/symbols';
import type { Partialize } from '../utils/types';
/**
* Represents a ban on Discord.
*
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
* @remarks has substructure `User`, which needs to be instantiated and stored by any extending classes using it.
*/
export class Ban<Omitted extends keyof APIBan | '' = ''> extends Structure<APIBan, Omitted> {
/**
* @param data - The raw data from the API for the ban.
*/
public constructor(data: Partialize<APIBan, Omitted>) {
super(data);
}
/**
* The reason for the ban.
*/
public get reason() {
return this[kData].reason;
}
}