-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathBan.ts
More file actions
31 lines (28 loc) · 979 Bytes
/
Ban.ts
File metadata and controls
31 lines (28 loc) · 979 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
27
28
29
30
31
import type { APIBan } from 'discord-api-types/v10';
import { Structure } from '../Structure.js';
import { kData } from '../utils/symbols.js';
import type { Partialize } from '../utils/types.js';
/**
* 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> {
/**
* The template used for removing data from the raw data stored for each ban.
*/
public static override readonly DataTemplate: Partial<APIBan> = {};
/**
* @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;
}
}