@notidotbot/noti-api-client 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cname.js +3 -0
- package/dist/classes/@me.d.ts +122 -0
- package/dist/classes/@me.js +59 -0
- package/dist/classes/admin.d.ts +71 -0
- package/dist/classes/admin.js +26 -0
- package/dist/classes/client.d.ts +156 -0
- package/dist/classes/client.js +116 -0
- package/dist/classes/emotes.d.ts +31 -0
- package/dist/classes/emotes.js +24 -0
- package/dist/classes/files.d.ts +36 -0
- package/dist/classes/files.js +36 -0
- package/dist/classes/guild.d.ts +187 -0
- package/dist/classes/guild.js +140 -0
- package/dist/classes/guildDrops.d.ts +58 -0
- package/dist/classes/guildDrops.js +32 -0
- package/dist/classes/guildGiveaway.d.ts +110 -0
- package/dist/classes/guildGiveaway.js +76 -0
- package/dist/classes/guildPlatform.d.ts +163 -0
- package/dist/classes/guildPlatform.js +99 -0
- package/dist/classes/guildPlatformAction.d.ts +67 -0
- package/dist/classes/guildPlatformAction.js +26 -0
- package/dist/classes/guildStarboard.d.ts +66 -0
- package/dist/classes/guildStarboard.js +36 -0
- package/dist/classes/linked.d.ts +26 -0
- package/dist/classes/linked.js +32 -0
- package/dist/classes/other.d.ts +83 -0
- package/dist/classes/other.js +53 -0
- package/dist/classes/platform.d.ts +227 -0
- package/dist/classes/platform.js +30 -0
- package/dist/classes/premium.d.ts +179 -0
- package/dist/classes/premium.js +76 -0
- package/dist/classes/sessions.d.ts +42 -0
- package/dist/classes/sessions.js +30 -0
- package/dist/classes/teams.d.ts +88 -0
- package/dist/classes/teams.js +66 -0
- package/dist/classes/telemetry.d.ts +32 -0
- package/dist/classes/telemetry.js +28 -0
- package/dist/classes/user.d.ts +40 -0
- package/dist/classes/user.js +30 -0
- package/dist/classes/vods.d.ts +55 -0
- package/dist/classes/vods.js +38 -0
- package/dist/core/manager.d.ts +57 -0
- package/dist/core/manager.js +78 -0
- package/dist/core/utils.d.ts +4 -0
- package/dist/core/utils.js +26 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +42 -0
- package/dist/modules/stripe.d.ts +12 -0
- package/dist/modules/stripe.js +18 -0
- package/dist/other/bitfields.d.ts +283 -0
- package/dist/other/bitfields.js +323 -0
- package/dist/other/enums.d.ts +2 -0
- package/dist/other/enums.js +10 -0
- package/dist/other/prisma.d.ts +76 -0
- package/dist/other/prisma.js +9 -0
- package/dist/other/templates.d.ts +795 -0
- package/dist/other/templates.js +706 -0
- package/dist/other/types.d.ts +45 -0
- package/dist/other/types.js +17 -0
- package/dist/other/utils.d.ts +5 -0
- package/dist/other/utils.js +51 -0
- package/dist/other/zod/client.zod.d.ts +349 -0
- package/dist/other/zod/client.zod.js +63 -0
- package/dist/other/zod/drops.zod.d.ts +16 -0
- package/dist/other/zod/drops.zod.js +93 -0
- package/dist/other/zod/giveaways.zod.d.ts +382 -0
- package/dist/other/zod/giveaways.zod.js +72 -0
- package/dist/other/zod/guild.zod.d.ts +1638 -0
- package/dist/other/zod/guild.zod.js +139 -0
- package/dist/other/zod/kickStreamer.zod.d.ts +761 -0
- package/dist/other/zod/kickStreamer.zod.js +92 -0
- package/dist/other/zod/member.zod.d.ts +22 -0
- package/dist/other/zod/member.zod.js +15 -0
- package/dist/other/zod/r2Storage.zod.d.ts +56 -0
- package/dist/other/zod/r2Storage.zod.js +21 -0
- package/dist/other/zod/rumbleStreamer.zod.d.ts +530 -0
- package/dist/other/zod/rumbleStreamer.zod.js +45 -0
- package/dist/other/zod/schema.zod.d.ts +25 -0
- package/dist/other/zod/schema.zod.js +168 -0
- package/dist/other/zod/starboard.zod.d.ts +167 -0
- package/dist/other/zod/starboard.zod.js +46 -0
- package/dist/other/zod/team.zod.d.ts +107 -0
- package/dist/other/zod/team.zod.js +30 -0
- package/dist/other/zod/tiktokStreamer.zod.d.ts +473 -0
- package/dist/other/zod/tiktokStreamer.zod.js +46 -0
- package/dist/other/zod/twitchStreamer.zod.d.ts +473 -0
- package/dist/other/zod/twitchStreamer.zod.js +46 -0
- package/dist/other/zod/user.zod.d.ts +678 -0
- package/dist/other/zod/user.zod.js +124 -0
- package/dist/other/zod/youtubeStreamer.zod.d.ts +476 -0
- package/dist/other/zod/youtubeStreamer.zod.js +47 -0
- package/dist/other/zod/zod.d.ts +177 -0
- package/dist/other/zod/zod.js +60 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +37 -0
- package/dist/types.js +2 -0
- package/package.json +63 -0
- package/prisma/generated/index.ts +25 -0
- package/prisma/generated/ts-prisma.d.ts +91725 -0
- package/prisma/schema/models/client.prisma +89 -0
- package/prisma/schema/models/drops.prisma +167 -0
- package/prisma/schema/models/giveaways.prisma +82 -0
- package/prisma/schema/models/guild.prisma +368 -0
- package/prisma/schema/models/kickStreamer.prisma +202 -0
- package/prisma/schema/models/member.prisma +10 -0
- package/prisma/schema/models/r2Storage.prisma +22 -0
- package/prisma/schema/models/rumbleStreamer.prisma +121 -0
- package/prisma/schema/models/starboard.prisma +66 -0
- package/prisma/schema/models/team.prisma +38 -0
- package/prisma/schema/models/tiktokStreamer.prisma +121 -0
- package/prisma/schema/models/twitchStreamer.prisma +122 -0
- package/prisma/schema/models/user.prisma +212 -0
- package/prisma/schema/models/youtubeStreamer.prisma +123 -0
- package/prisma/schema/schema.prisma +182 -0
- package/prisma.config.ts +6 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIFiles = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIFiles {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getFiles({ auth }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/data/files'),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async uploadFile({ auth, key, file }) {
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
formData.append('key', key);
|
|
20
|
+
formData.append('file', file);
|
|
21
|
+
return await this.web.request({
|
|
22
|
+
method: 'POST', auth,
|
|
23
|
+
endpoint: this.web.qp('/data/files'),
|
|
24
|
+
body: formData,
|
|
25
|
+
headers: null,
|
|
26
|
+
doNotStringify: true,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async deleteFile({ auth, key }) {
|
|
30
|
+
return await this.web.request({
|
|
31
|
+
method: 'DELETE', auth,
|
|
32
|
+
endpoint: this.web.qp('/data/files/' + key),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.APIFiles = APIFiles;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { GuildMessageTypeEnum, GuildSingleMessageTypeEnum } from '@prisma/client';
|
|
2
|
+
import { CancelOutWebResponses, DeepPartial } from '../types';
|
|
3
|
+
import { Guild, GuildZod } from '../other/prisma';
|
|
4
|
+
import { WebDataManager } from '../core/manager';
|
|
5
|
+
import { AddonNames } from '../modules/stripe';
|
|
6
|
+
export declare class APIGuild {
|
|
7
|
+
private web;
|
|
8
|
+
constructor(web: WebDataManager);
|
|
9
|
+
getGuild({ auth, guildId }: GuildFunctionsInput['getGuild']): Promise<import("../types").WebResponse<GuildWithStuff>>;
|
|
10
|
+
updateGuild({ auth, guildId, guild }: GuildFunctionsInput['updateGuild']): Promise<import("../types").WebResponse<string>>;
|
|
11
|
+
getGuildErrors({ auth, guildId }: GuildFunctionsInput['getGuildErrors']): Promise<import("../types").WebResponse<GuildErrors>>;
|
|
12
|
+
clearGuildErrors({ auth, guildId }: GuildFunctionsInput['clearGuildErrors']): Promise<import("../types").WebResponse<string>>;
|
|
13
|
+
sendGuildPanelOrNotification<T extends SendPanelType>({ auth, guildId, panel, body }: GuildFunctionsInput<T>['sendGuildPanelOrNotification']): Promise<import("../types").WebResponse<string>>;
|
|
14
|
+
sendTestKickBotNotification({ auth, guildId, streamer, type }: GuildFunctionsInput['sendTestKickBotNotification']): Promise<import("../types").WebResponse<string>>;
|
|
15
|
+
sendGreetOrBirthdayMessage({ auth, guildId, type }: GuildFunctionsInput['sendGreetOrBirthdayMessage']): Promise<import("../types").WebResponse<string>>;
|
|
16
|
+
createOrUpdateGuildMessage<T extends GuildMessageType, S extends GuildMessageSubType<T>>({ auth, guildId, messageType, messageSubType, data }: GuildFunctionsInput<never, T, S>['createOrUpdateGuildMessage']): Promise<import("../types").WebResponse<string>>;
|
|
17
|
+
deleteGuildMessage<T extends GuildMessageType, S extends GuildMessageSubType<T>>({ auth, guildId, messageType, messageSubType }: GuildFunctionsInput<never, T, S>['deleteGuildMessage']): Promise<import("../types").WebResponse<string>>;
|
|
18
|
+
createOrUpdateGuildRoles<T extends GuildRoleType>({ auth, guildId, type, roleId, data }: GuildFunctionsInput<never, never, never, T>['createOrUpdateGuildRoles']): Promise<import("../types").WebResponse<string>>;
|
|
19
|
+
deleteGuildRoles<T extends GuildRoleType>({ auth, guildId, type, roleId }: GuildFunctionsInput<never, never, never, T>['deleteGuildRoles']): Promise<import("../types").WebResponse<string>>;
|
|
20
|
+
createOrUpdateOverride({ auth, guildId, priorityOnConflict, data }: GuildFunctionsInput['createOrUpdateOverride']): Promise<import("../types").WebResponse<string>>;
|
|
21
|
+
deleteOverride({ auth, guildId, priorityOnConflict }: GuildFunctionsInput['deleteOverride']): Promise<import("../types").WebResponse<string>>;
|
|
22
|
+
createOrUpdateStickyMessage({ auth, guildId, data, channelId }: GuildFunctionsInput['createOrUpdateStickyMessage']): Promise<import("../types").WebResponse<string>>;
|
|
23
|
+
deleteStickyMessage({ auth, guildId, channelId }: GuildFunctionsInput['deleteStickyMessage']): Promise<import("../types").WebResponse<string>>;
|
|
24
|
+
createOrUpdateLinkedRole({ auth, guildId, data, roleId }: GuildFunctionsInput['createOrUpdateLinkedRole']): Promise<import("../types").WebResponse<string>>;
|
|
25
|
+
deleteLinkedRole({ auth, guildId, roleId }: GuildFunctionsInput['deleteLinkedRole']): Promise<import("../types").WebResponse<string>>;
|
|
26
|
+
}
|
|
27
|
+
export type GuildFunctionsInput<T extends SendPanelType = never, T2 extends GuildMessageType = never, S extends GuildMessageSubType<T2> = never, T3 extends GuildRoleType = never> = {
|
|
28
|
+
'getGuild': {
|
|
29
|
+
auth: string;
|
|
30
|
+
guildId: string;
|
|
31
|
+
};
|
|
32
|
+
'updateGuild': {
|
|
33
|
+
auth: string;
|
|
34
|
+
guildId: string;
|
|
35
|
+
guild: DeepPartial<GuildZod>;
|
|
36
|
+
};
|
|
37
|
+
'sendGuildPanelOrNotification': {
|
|
38
|
+
auth: string;
|
|
39
|
+
guildId: string;
|
|
40
|
+
panel: T;
|
|
41
|
+
body: SendPanelBody<T>;
|
|
42
|
+
dontPing?: boolean;
|
|
43
|
+
};
|
|
44
|
+
'sendTestKickBotNotification': {
|
|
45
|
+
auth: string;
|
|
46
|
+
guildId: string;
|
|
47
|
+
streamer: string;
|
|
48
|
+
type: 'vod' | 'clip';
|
|
49
|
+
};
|
|
50
|
+
'getGuildErrors': {
|
|
51
|
+
auth: string;
|
|
52
|
+
guildId: string;
|
|
53
|
+
};
|
|
54
|
+
'clearGuildErrors': {
|
|
55
|
+
auth: string;
|
|
56
|
+
guildId: string;
|
|
57
|
+
};
|
|
58
|
+
'createOrUpdateGuildMessage': {
|
|
59
|
+
auth: string;
|
|
60
|
+
guildId: string;
|
|
61
|
+
messageType: T2;
|
|
62
|
+
messageSubType: S;
|
|
63
|
+
data: GuildMessageBody<T2>;
|
|
64
|
+
};
|
|
65
|
+
'deleteGuildMessage': {
|
|
66
|
+
auth: string;
|
|
67
|
+
guildId: string;
|
|
68
|
+
messageType: T2;
|
|
69
|
+
messageSubType: S;
|
|
70
|
+
};
|
|
71
|
+
'createOrUpdateGuildRoles': {
|
|
72
|
+
auth: string;
|
|
73
|
+
guildId: string;
|
|
74
|
+
type: T3;
|
|
75
|
+
roleId: string;
|
|
76
|
+
data: GuildRoleBody<T3>;
|
|
77
|
+
};
|
|
78
|
+
'deleteGuildRoles': {
|
|
79
|
+
auth: string;
|
|
80
|
+
guildId: string;
|
|
81
|
+
type: T3;
|
|
82
|
+
roleId: string;
|
|
83
|
+
};
|
|
84
|
+
'createOrUpdateOverride': {
|
|
85
|
+
auth: string;
|
|
86
|
+
guildId: string;
|
|
87
|
+
priorityOnConflict: number;
|
|
88
|
+
data: GuildZod['notificationOverrides'][number];
|
|
89
|
+
};
|
|
90
|
+
'deleteOverride': {
|
|
91
|
+
auth: string;
|
|
92
|
+
guildId: string;
|
|
93
|
+
priorityOnConflict: number;
|
|
94
|
+
};
|
|
95
|
+
'createOrUpdateStickyMessage': {
|
|
96
|
+
auth: string;
|
|
97
|
+
guildId: string;
|
|
98
|
+
channelId: string;
|
|
99
|
+
data: GuildZod['stickyMessages'][number];
|
|
100
|
+
};
|
|
101
|
+
'deleteStickyMessage': {
|
|
102
|
+
auth: string;
|
|
103
|
+
guildId: string;
|
|
104
|
+
channelId: string;
|
|
105
|
+
};
|
|
106
|
+
'createOrUpdateLinkedRole': {
|
|
107
|
+
auth: string;
|
|
108
|
+
guildId: string;
|
|
109
|
+
roleId: string;
|
|
110
|
+
data: GuildZod['linkedRoles'][number];
|
|
111
|
+
};
|
|
112
|
+
'deleteLinkedRole': {
|
|
113
|
+
auth: string;
|
|
114
|
+
guildId: string;
|
|
115
|
+
roleId: string;
|
|
116
|
+
};
|
|
117
|
+
'sendGreetOrBirthdayMessage': {
|
|
118
|
+
auth: string;
|
|
119
|
+
guildId: string;
|
|
120
|
+
type: 'welcome' | 'leave' | 'birthday';
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export type GuildReturnTypes = {
|
|
124
|
+
'getGuildRaw': Awaited<ReturnType<APIGuild['getGuild']>>;
|
|
125
|
+
'getGuildSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['getGuild']>>>;
|
|
126
|
+
'updateGuildRaw': Awaited<ReturnType<APIGuild['updateGuild']>>;
|
|
127
|
+
'updateGuildSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['updateGuild']>>>;
|
|
128
|
+
'sendGuildPanelOrNotificationRaw': Awaited<ReturnType<APIGuild['sendGuildPanelOrNotification']>>;
|
|
129
|
+
'sendGuildPanelOrNotificationSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['sendGuildPanelOrNotification']>>>;
|
|
130
|
+
'sendTestKickBotNotificationRaw': Awaited<ReturnType<APIGuild['sendTestKickBotNotification']>>;
|
|
131
|
+
'sendTestKickBotNotificationSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['sendTestKickBotNotification']>>>;
|
|
132
|
+
'getGuildErrorsRaw': Awaited<ReturnType<APIGuild['getGuildErrors']>>;
|
|
133
|
+
'getGuildErrorsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['getGuildErrors']>>>;
|
|
134
|
+
'clearGuildErrorsRaw': Awaited<ReturnType<APIGuild['clearGuildErrors']>>;
|
|
135
|
+
'clearGuildErrorsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['clearGuildErrors']>>>;
|
|
136
|
+
'createOrUpdateGuildMessageRaw': Awaited<ReturnType<APIGuild['createOrUpdateGuildMessage']>>;
|
|
137
|
+
'createOrUpdateGuildMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createOrUpdateGuildMessage']>>>;
|
|
138
|
+
'deleteGuildMessageRaw': Awaited<ReturnType<APIGuild['deleteGuildMessage']>>;
|
|
139
|
+
'deleteGuildMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['deleteGuildMessage']>>>;
|
|
140
|
+
'createOrUpdateGuildRolesRaw': Awaited<ReturnType<APIGuild['createOrUpdateGuildRoles']>>;
|
|
141
|
+
'createOrUpdateGuildRolesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createOrUpdateGuildRoles']>>>;
|
|
142
|
+
'deleteGuildRolesRaw': Awaited<ReturnType<APIGuild['deleteGuildRoles']>>;
|
|
143
|
+
'deleteGuildRolesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['deleteGuildRoles']>>>;
|
|
144
|
+
'createOrUpdateOverrideRaw': Awaited<ReturnType<APIGuild['createOrUpdateOverride']>>;
|
|
145
|
+
'createOrUpdateOverrideSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createOrUpdateOverride']>>>;
|
|
146
|
+
'deleteOverrideRaw': Awaited<ReturnType<APIGuild['deleteOverride']>>;
|
|
147
|
+
'deleteOverrideSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['deleteOverride']>>>;
|
|
148
|
+
'createOrUpdateStickyMessageRaw': Awaited<ReturnType<APIGuild['createOrUpdateStickyMessage']>>;
|
|
149
|
+
'createOrUpdateStickyMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createOrUpdateStickyMessage']>>>;
|
|
150
|
+
'deleteStickyMessageRaw': Awaited<ReturnType<APIGuild['deleteStickyMessage']>>;
|
|
151
|
+
'deleteStickyMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['deleteStickyMessage']>>>;
|
|
152
|
+
'createOrUpdateLinkedRoleRaw': Awaited<ReturnType<APIGuild['createOrUpdateLinkedRole']>>;
|
|
153
|
+
'createOrUpdateLinkedRoleSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createOrUpdateLinkedRole']>>>;
|
|
154
|
+
'deleteLinkedRoleRaw': Awaited<ReturnType<APIGuild['deleteLinkedRole']>>;
|
|
155
|
+
'deleteLinkedRoleSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['deleteLinkedRole']>>>;
|
|
156
|
+
'sendGreetOrBirthdayMessageRaw': Awaited<ReturnType<APIGuild['sendGreetOrBirthdayMessage']>>;
|
|
157
|
+
'sendGreetOrBirthdayMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['sendGreetOrBirthdayMessage']>>>;
|
|
158
|
+
};
|
|
159
|
+
export type SendPanelType = 'sync' | 'kickLeaderboard' | 'statCounters' | 'birthday';
|
|
160
|
+
export type SendPanelBody<T extends SendPanelType> = T extends 'sync' ? {
|
|
161
|
+
syncChannel: string;
|
|
162
|
+
platform: 'kick';
|
|
163
|
+
} : T extends 'kickLeaderboard' ? {
|
|
164
|
+
streamerUserName: string;
|
|
165
|
+
leaderBoardChannelId?: string;
|
|
166
|
+
leaderBoardTypes?: ('weekly' | 'monthly' | 'overall')[];
|
|
167
|
+
} : T extends 'statCounters' ? {
|
|
168
|
+
streamerUserName: string;
|
|
169
|
+
platform: 'kick';
|
|
170
|
+
types: ('followers' | 'liveUpdates')[];
|
|
171
|
+
} : T extends 'birthday' ? {
|
|
172
|
+
birthdayChannelId?: string;
|
|
173
|
+
} : never;
|
|
174
|
+
export type GuildErrors = {
|
|
175
|
+
time: number;
|
|
176
|
+
message: string;
|
|
177
|
+
missingPermissions?: string[];
|
|
178
|
+
}[];
|
|
179
|
+
export type GuildWithStuff = Guild & {
|
|
180
|
+
isPremium: boolean;
|
|
181
|
+
limits: Record<`max${AddonNames extends string ? AddonNames : never}`, number>;
|
|
182
|
+
};
|
|
183
|
+
export type GuildMessageType = 'customMessages' | 'singleMessages' | 'randomMessages';
|
|
184
|
+
export type GuildMessageSubType<T extends GuildMessageType> = T extends 'customMessages' ? GuildMessageTypeEnum : T extends 'singleMessages' ? GuildSingleMessageTypeEnum : T extends 'randomMessages' ? GuildMessageTypeEnum : never;
|
|
185
|
+
export type GuildMessageBody<T extends GuildMessageType> = T extends 'customMessages' ? GuildZod['messages'][number] : T extends 'singleMessages' ? GuildZod['singleMessages'][number] : T extends 'randomMessages' ? GuildZod['randomMessages'][number] : never;
|
|
186
|
+
export type GuildRoleType = 'statusRoles' | 'autoLiveRoles';
|
|
187
|
+
export type GuildRoleBody<T extends GuildRoleType> = T extends 'statusRoles' ? GuildZod['statusRoles'][number] : T extends 'autoLiveRoles' ? GuildZod['autoLiveRoles'][number] : never;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIGuild = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIGuild {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getGuild({ auth, guildId }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/data/guild/' + guildId),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async updateGuild({ auth, guildId, guild }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'PATCH', auth, body: guild,
|
|
20
|
+
endpoint: this.web.qp('/data/guild/' + guildId),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async getGuildErrors({ auth, guildId }) {
|
|
24
|
+
return await this.web.request({
|
|
25
|
+
method: 'GET', auth,
|
|
26
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/errors'),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async clearGuildErrors({ auth, guildId }) {
|
|
30
|
+
return await this.web.request({
|
|
31
|
+
method: 'DELETE', auth,
|
|
32
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/errors'),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async sendGuildPanelOrNotification({ auth, guildId, panel, body }) {
|
|
36
|
+
return await this.web.request({
|
|
37
|
+
method: 'PUT', auth, body,
|
|
38
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/panel/' + panel),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async sendTestKickBotNotification({ auth, guildId, streamer, type }) {
|
|
42
|
+
return await this.web.request({
|
|
43
|
+
method: 'PUT', auth,
|
|
44
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/kickbot/' + type, {
|
|
45
|
+
streamerUserName: streamer,
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async sendGreetOrBirthdayMessage({ auth, guildId, type }) {
|
|
50
|
+
return await this.web.request({
|
|
51
|
+
method: 'PUT', auth,
|
|
52
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/greet/' + type),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async createOrUpdateGuildMessage({ auth, guildId, messageType, messageSubType, data }) {
|
|
56
|
+
return await this.web.request({
|
|
57
|
+
method: 'PATCH', auth, body: data,
|
|
58
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/messages`, {
|
|
59
|
+
type: messageType,
|
|
60
|
+
subType: messageSubType,
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async deleteGuildMessage({ auth, guildId, messageType, messageSubType }) {
|
|
65
|
+
return await this.web.request({
|
|
66
|
+
method: 'DELETE', auth,
|
|
67
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/messages`, {
|
|
68
|
+
type: messageType,
|
|
69
|
+
subType: messageSubType,
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async createOrUpdateGuildRoles({ auth, guildId, type, roleId, data }) {
|
|
74
|
+
return await this.web.request({
|
|
75
|
+
method: 'PATCH', auth, body: data,
|
|
76
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/roles`, {
|
|
77
|
+
type: type,
|
|
78
|
+
roleId: roleId,
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async deleteGuildRoles({ auth, guildId, type, roleId }) {
|
|
83
|
+
return await this.web.request({
|
|
84
|
+
method: 'DELETE', auth,
|
|
85
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/roles`, {
|
|
86
|
+
type: type,
|
|
87
|
+
roleId: roleId,
|
|
88
|
+
}),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async createOrUpdateOverride({ auth, guildId, priorityOnConflict, data }) {
|
|
92
|
+
return await this.web.request({
|
|
93
|
+
method: 'PATCH', auth, body: data,
|
|
94
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/overrides`, {
|
|
95
|
+
priorityOnConflict: priorityOnConflict,
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async deleteOverride({ auth, guildId, priorityOnConflict }) {
|
|
100
|
+
return await this.web.request({
|
|
101
|
+
method: 'DELETE', auth,
|
|
102
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/overrides`, {
|
|
103
|
+
priorityOnConflict: priorityOnConflict,
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async createOrUpdateStickyMessage({ auth, guildId, data, channelId }) {
|
|
108
|
+
return await this.web.request({
|
|
109
|
+
method: 'PATCH', auth, body: data,
|
|
110
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/stickyMessages`, {
|
|
111
|
+
channelId: channelId,
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async deleteStickyMessage({ auth, guildId, channelId }) {
|
|
116
|
+
return await this.web.request({
|
|
117
|
+
method: 'DELETE', auth,
|
|
118
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/stickyMessages`, {
|
|
119
|
+
channelId: channelId,
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
async createOrUpdateLinkedRole({ auth, guildId, data, roleId }) {
|
|
124
|
+
return await this.web.request({
|
|
125
|
+
method: 'PATCH', auth, body: data,
|
|
126
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/linkedRoles`, {
|
|
127
|
+
roleId: roleId,
|
|
128
|
+
}),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
async deleteLinkedRole({ auth, guildId, roleId }) {
|
|
132
|
+
return await this.web.request({
|
|
133
|
+
method: 'DELETE', auth,
|
|
134
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/linkedRoles`, {
|
|
135
|
+
roleId: roleId,
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.APIGuild = APIGuild;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { WebDataManager } from '../core/manager';
|
|
2
|
+
import { CancelOutWebResponses } from '../types';
|
|
3
|
+
export declare class APIGuildDrops {
|
|
4
|
+
private web;
|
|
5
|
+
constructor(web: WebDataManager);
|
|
6
|
+
getGuildDrops({ auth, guildId }: GuildDropsFunctionsInput['getGuildDrops']): Promise<import("../types").WebResponse<GuildDropsData>>;
|
|
7
|
+
updateGuildDrops({ auth, guildId, kickEnabled, twitchEnabled, liveNotifications, channelId, roleId, webhook }: GuildDropsFunctionsInput['updateGuildDrops']): Promise<import("../types").WebResponse<GuildDropsData>>;
|
|
8
|
+
}
|
|
9
|
+
export type GuildDropsFunctionsInput = {
|
|
10
|
+
'getGuildDrops': {
|
|
11
|
+
auth: string;
|
|
12
|
+
guildId: string;
|
|
13
|
+
};
|
|
14
|
+
'updateGuildDrops': {
|
|
15
|
+
auth: string;
|
|
16
|
+
guildId: string;
|
|
17
|
+
kickEnabled?: boolean;
|
|
18
|
+
twitchEnabled?: boolean;
|
|
19
|
+
liveNotifications?: boolean;
|
|
20
|
+
channelId?: string | null;
|
|
21
|
+
roleId?: string | null;
|
|
22
|
+
webhook?: {
|
|
23
|
+
username?: string | null;
|
|
24
|
+
avatarUrl?: string | null;
|
|
25
|
+
} | null;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type GuildDropsReturnTypes = {
|
|
29
|
+
'getGuildDropsRaw': Awaited<ReturnType<APIGuildDrops['getGuildDrops']>>;
|
|
30
|
+
'getGuildDropsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildDrops['getGuildDrops']>>>;
|
|
31
|
+
'updateGuildDropsRaw': Awaited<ReturnType<APIGuildDrops['updateGuildDrops']>>;
|
|
32
|
+
'updateGuildDropsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildDrops['updateGuildDrops']>>>;
|
|
33
|
+
};
|
|
34
|
+
export type WebhookConfig = {
|
|
35
|
+
avatarUrl: string | null;
|
|
36
|
+
username: string | null;
|
|
37
|
+
};
|
|
38
|
+
export type GameDropConfig = {
|
|
39
|
+
id: string | null;
|
|
40
|
+
name: string | null;
|
|
41
|
+
slug: string | null;
|
|
42
|
+
imageUrl: string | null;
|
|
43
|
+
description: string | null;
|
|
44
|
+
platform: string | null;
|
|
45
|
+
channelId: string | null;
|
|
46
|
+
roleId: string | null;
|
|
47
|
+
liveNotifications: boolean | null;
|
|
48
|
+
webhook: WebhookConfig | null;
|
|
49
|
+
};
|
|
50
|
+
export type GuildDropsData = {
|
|
51
|
+
kickEnabled: boolean;
|
|
52
|
+
twitchEnabled: boolean;
|
|
53
|
+
liveNotifications: boolean;
|
|
54
|
+
channelId: string | null;
|
|
55
|
+
roleId: string | null;
|
|
56
|
+
webhook: WebhookConfig;
|
|
57
|
+
games: GameDropConfig[];
|
|
58
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIGuildDrops = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIGuildDrops {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getGuildDrops({ auth, guildId }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/drops`),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async updateGuildDrops({ auth, guildId, kickEnabled, twitchEnabled, liveNotifications, channelId, roleId, webhook }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'PATCH', auth,
|
|
20
|
+
endpoint: this.web.qp(`/data/guild/${guildId}/drops`),
|
|
21
|
+
body: {
|
|
22
|
+
kickEnabled,
|
|
23
|
+
twitchEnabled,
|
|
24
|
+
liveNotifications,
|
|
25
|
+
channelId,
|
|
26
|
+
roleId,
|
|
27
|
+
webhook,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.APIGuildDrops = APIGuildDrops;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { GuildGiveaway, GuildGiveawayCreateSchema, GuildGiveawayZod } from '../other/prisma';
|
|
2
|
+
import { CancelOutWebResponses, DeepPartial } from '../types';
|
|
3
|
+
import { WebDataManager } from '../core/manager';
|
|
4
|
+
export declare class APIGuildGiveaway {
|
|
5
|
+
private web;
|
|
6
|
+
constructor(web: WebDataManager);
|
|
7
|
+
getGuildGiveaways({ auth, guildId }: GuildGiveawayFunctionsInput['getGuildGiveaways']): Promise<import("../types").WebResponse<GuildGiveawaysType>>;
|
|
8
|
+
getGuildGiveaway({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['getGuildGiveaway']): Promise<import("../types").WebResponse<GuildGiveawayWithEntry>>;
|
|
9
|
+
getGuildGiveawayEntries({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['getGuildGiveawayEntries']): Promise<import("../types").WebResponse<{
|
|
10
|
+
dbId: string;
|
|
11
|
+
entries: number;
|
|
12
|
+
username: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
guildGiveawayId: string;
|
|
15
|
+
}[]>>;
|
|
16
|
+
createGiveaway<T extends WhenCreate>({ auth, guildId, body, when }: GuildGiveawayFunctionsInput<T>['createGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
17
|
+
updateGiveaway({ auth, guildId, giveawayId, body }: GuildGiveawayFunctionsInput['updateGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
18
|
+
resendGiveawayMessage({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['resendGiveawayMessage']): Promise<import("../types").WebResponse<string>>;
|
|
19
|
+
startScheduledGiveaway({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['startScheduledGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
20
|
+
endGiveaway({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['endGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
21
|
+
rerollGiveaway({ auth, guildId, giveawayId }: GuildGiveawayFunctionsInput['rerollGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
22
|
+
deleteGiveaway({ auth, guildId, giveawayId, type }: GuildGiveawayFunctionsInput['deleteGiveaway']): Promise<import("../types").WebResponse<string>>;
|
|
23
|
+
}
|
|
24
|
+
export type GuildGiveawayFunctionsInput<T extends WhenCreate = never> = {
|
|
25
|
+
'getGuildGiveaways': {
|
|
26
|
+
auth: string;
|
|
27
|
+
guildId: string;
|
|
28
|
+
};
|
|
29
|
+
'getGuildGiveaway': {
|
|
30
|
+
auth: string;
|
|
31
|
+
guildId: string;
|
|
32
|
+
giveawayId: string;
|
|
33
|
+
};
|
|
34
|
+
'startScheduledGiveaway': {
|
|
35
|
+
auth: string;
|
|
36
|
+
guildId: string;
|
|
37
|
+
giveawayId: string;
|
|
38
|
+
};
|
|
39
|
+
'getGuildGiveawayEntries': {
|
|
40
|
+
auth: string;
|
|
41
|
+
guildId: string;
|
|
42
|
+
giveawayId: string;
|
|
43
|
+
};
|
|
44
|
+
'createGiveaway': {
|
|
45
|
+
auth: string;
|
|
46
|
+
guildId: string;
|
|
47
|
+
body: GuildGiveawayCreateSchema & {
|
|
48
|
+
startInMinutes: T extends 'later' ? number : 0;
|
|
49
|
+
};
|
|
50
|
+
when: T;
|
|
51
|
+
};
|
|
52
|
+
'updateGiveaway': {
|
|
53
|
+
auth: string;
|
|
54
|
+
guildId: string;
|
|
55
|
+
giveawayId: string;
|
|
56
|
+
body: Pick<DeepPartial<GuildGiveawayZod>, 'winnerCount' | 'durationMinutes' | 'name'>;
|
|
57
|
+
};
|
|
58
|
+
'resendGiveawayMessage': {
|
|
59
|
+
auth: string;
|
|
60
|
+
guildId: string;
|
|
61
|
+
giveawayId: string;
|
|
62
|
+
};
|
|
63
|
+
'deleteGiveaway': {
|
|
64
|
+
auth: string;
|
|
65
|
+
guildId: string;
|
|
66
|
+
giveawayId: string;
|
|
67
|
+
type: StateType;
|
|
68
|
+
};
|
|
69
|
+
'endGiveaway': {
|
|
70
|
+
auth: string;
|
|
71
|
+
guildId: string;
|
|
72
|
+
giveawayId: string;
|
|
73
|
+
};
|
|
74
|
+
'rerollGiveaway': {
|
|
75
|
+
auth: string;
|
|
76
|
+
guildId: string;
|
|
77
|
+
giveawayId: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export type GuildGiveawayReturnTypes = {
|
|
81
|
+
'getGuildStreamersRaw': Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaways']>>;
|
|
82
|
+
'getGuildStreamersSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaways']>>>;
|
|
83
|
+
'getGuildGiveawayEntriesRaw': Awaited<ReturnType<APIGuildGiveaway['getGuildGiveawayEntries']>>;
|
|
84
|
+
'getGuildGiveawayEntriesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['getGuildGiveawayEntries']>>>;
|
|
85
|
+
'createGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['createGiveaway']>>;
|
|
86
|
+
'createGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['createGiveaway']>>>;
|
|
87
|
+
'updateGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['updateGiveaway']>>;
|
|
88
|
+
'updateGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['updateGiveaway']>>>;
|
|
89
|
+
'resendGiveawayMessageRaw': Awaited<ReturnType<APIGuildGiveaway['resendGiveawayMessage']>>;
|
|
90
|
+
'resendGiveawayMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['resendGiveawayMessage']>>>;
|
|
91
|
+
'deleteGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['deleteGiveaway']>>;
|
|
92
|
+
'deleteGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['deleteGiveaway']>>>;
|
|
93
|
+
'endGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['endGiveaway']>>;
|
|
94
|
+
'endGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['endGiveaway']>>>;
|
|
95
|
+
'rerollGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['rerollGiveaway']>>;
|
|
96
|
+
'rerollGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['rerollGiveaway']>>>;
|
|
97
|
+
};
|
|
98
|
+
export type WhenCreate = 'now' | 'later';
|
|
99
|
+
export type StateType = 'live' | 'scheduled';
|
|
100
|
+
export type GuildGiveawaysType = {
|
|
101
|
+
existing: GuildGiveawayWithEntry[];
|
|
102
|
+
scheduled: {
|
|
103
|
+
data: GuildGiveawayCreateSchema;
|
|
104
|
+
shouldStartAt: Date;
|
|
105
|
+
}[];
|
|
106
|
+
};
|
|
107
|
+
export type GuildGiveawayEntriesType = GuildGiveaway['currentEntries'];
|
|
108
|
+
export type GuildGiveawayWithEntry = Omit<GuildGiveaway, 'currentEntries'> & {
|
|
109
|
+
currentEntries: number;
|
|
110
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIGuildGiveaway = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIGuildGiveaway {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getGuildGiveaways({ auth, guildId }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async getGuildGiveaway({ auth, guildId, giveawayId }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'GET', auth,
|
|
20
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async getGuildGiveawayEntries({ auth, guildId, giveawayId }) {
|
|
24
|
+
return await this.web.request({
|
|
25
|
+
method: 'GET', auth,
|
|
26
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId + '/entries'),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async createGiveaway({ auth, guildId, body, when }) {
|
|
30
|
+
return await this.web.request({
|
|
31
|
+
method: 'POST', auth, body,
|
|
32
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId, {
|
|
33
|
+
when: when,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async updateGiveaway({ auth, guildId, giveawayId, body }) {
|
|
38
|
+
return await this.web.request({
|
|
39
|
+
method: 'PATCH', auth, body,
|
|
40
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async resendGiveawayMessage({ auth, guildId, giveawayId }) {
|
|
44
|
+
return await this.web.request({
|
|
45
|
+
method: 'POST', auth,
|
|
46
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId + '/resend'),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async startScheduledGiveaway({ auth, guildId, giveawayId }) {
|
|
50
|
+
return await this.web.request({
|
|
51
|
+
method: 'POST', auth,
|
|
52
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId + '/start'),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async endGiveaway({ auth, guildId, giveawayId }) {
|
|
56
|
+
return await this.web.request({
|
|
57
|
+
method: 'POST', auth,
|
|
58
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId + '/end'),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async rerollGiveaway({ auth, guildId, giveawayId }) {
|
|
62
|
+
return await this.web.request({
|
|
63
|
+
method: 'POST', auth,
|
|
64
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId + '/reroll'),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async deleteGiveaway({ auth, guildId, giveawayId, type }) {
|
|
68
|
+
return await this.web.request({
|
|
69
|
+
method: 'DELETE', auth,
|
|
70
|
+
endpoint: this.web.qp('/data/giveaways/' + guildId + '/' + giveawayId, {
|
|
71
|
+
type,
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.APIGuildGiveaway = APIGuildGiveaway;
|