-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathguildSplashURL.ts
More file actions
48 lines (46 loc) · 1.24 KB
/
guildSplashURL.ts
File metadata and controls
48 lines (46 loc) · 1.24 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright © 2026 BotForge
*/
import { ImageExtension, ImageSize } from "discord.js"
import { ArgType, NativeFunction, Return } from "../../structures"
export default new NativeFunction({
name: "$guildSplashURL",
version: "1.0.0",
aliases: [
"$serverSplashURL"
],
output: ArgType.URL,
description: "Returns the guild splash url",
brackets: false,
args: [
{
name: "guild ID",
description: "The guild to retrieve the splash",
rest: false,
required: true,
type: ArgType.Guild,
},
{
name: "size",
description: "The size to use for the image",
rest: false,
type: ArgType.Number,
},
{
name: "extension",
description: "The extension to use for the image",
rest: false,
type: ArgType.String,
},
],
unwrap: true,
execute(ctx, [g, size, ext]) {
return this.success(
(g ?? ctx.guild)?.splashURL({
extension: (ext as ImageExtension) || undefined,
size: (size as ImageSize) || 2048,
})
)
},
})