Skip to content

Commit 4286792

Browse files
committed
Clone and revamp local functions
1 parent d13fdfd commit 4286792

File tree

123 files changed

+325
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+325
-282
lines changed

dist/core/Interpreter.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AutoModerationRule, Channel, Entitlement, Guild, GuildAuditLogsEntry, GuildBan, GuildEmoji, GuildMember, GuildScheduledEvent, Invite, Message, PartialMessage, PartialPollAnswer, PartialSoundboardSound, PollAnswer, Presence, Role, SoundboardSound, StageInstance, Sticker, Subscription, User, VoiceChannelEffect, VoiceState } from "discord.js";
22
import { IExtendedCompilationResult } from ".";
3-
import { Sendable, BaseCommand, Context, Container } from "../structures";
3+
import { Sendable, BaseCommand, Context, Container, ILocalFunctionData } from "../structures";
44
import { ForgeClient } from "./ForgeClient";
55
export interface IStates {
66
message: Message;
@@ -73,11 +73,15 @@ export interface IRunnable {
7373
/**
7474
* The already existing variables defined with $let
7575
*/
76-
keywords?: Record<string, string>;
76+
keywords?: Record<string, unknown>;
7777
/**
7878
* The already existing env variables
7979
*/
8080
environment?: Record<string, unknown>;
81+
/**
82+
* The already existing local functions
83+
*/
84+
localFunctions?: Record<string, ILocalFunctionData>;
8185
/**
8286
* The args used in the message command
8387
*/

dist/core/Interpreter.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core/Interpreter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/native/other/callLocalFunction.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/native/other/callLocalFunction.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/native/other/localFunction.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/native/other/localFunction.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/structures/@internal/Context.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export declare class Context {
9393
component: Partial<IComponentOptions>;
9494
timezone: string;
9595
calendar?: CalendarType;
96-
localFunctions: Map<string, ILocalFunctionData>;
9796
private _reason?;
9897
container: Container;
9998
constructor(runtime: IRunnable);
@@ -141,6 +140,9 @@ export declare class Context {
141140
deleteKeyword(name: string): boolean;
142141
setKeyword(name: string, value: unknown): unknown;
143142
hasKeyword(name: string): boolean;
143+
getLocalFunction(name: string): ILocalFunctionData;
144+
deleteLocalFunction(name: string): boolean;
145+
setLocalFunction(name: string, data: ILocalFunctionData): ILocalFunctionData;
144146
clearKeywords(): void;
145147
clearEnvironment(): void;
146148
isSelectMenu(): this is this & {
@@ -170,7 +172,7 @@ export declare class Context {
170172
};
171173
cloneEmpty(): Context;
172174
/**
173-
* Clones keywords and environment vars
175+
* Clones keywords, environment vars, and local functions.
174176
* @returns
175177
*/
176178
clone(props?: Partial<IRunnable>, syncVars?: boolean): Context;

0 commit comments

Comments
 (0)