-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcharCodeAt.ts
More file actions
34 lines (32 loc) · 854 Bytes
/
charCodeAt.ts
File metadata and controls
34 lines (32 loc) · 854 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
32
33
34
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright © 2026 BotForge
*/
import { ArgType, NativeFunction, Return } from "../../structures"
export default new NativeFunction({
name: "$charCodeAt",
version: "1.0.6",
description: "Returns the char code at given index",
brackets: true,
unwrap: true,
output: ArgType.Number,
args: [
{
name: "message",
description: "The string to get char code of",
rest: false,
required: true,
type: ArgType.String,
},
{
name: "index",
description: "The index to get its char code",
type: ArgType.Number,
rest: false,
required: true,
},
],
execute(ctx, [m, index]) {
return this.success(m.charCodeAt(index))
},
})