
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
@eds-fw/framework
Advanced tools
Simply TypeScript framework for your discord.js bots
/help commandcreateSlashCommand(), createButton() and more)sfMember(context, userId) and more)get(), set(), save() and moreInteractivePanel)getAvatar(), quickEmbed(), optionsWithDefaultValue() and expandDirs()v18 or newernpm i @eds-fw/framework
tsconfig.json file:{
"extends": "./node_modules/@eds-fw/framework/tsconfig.base.json",
"exclude": [
"node_modules/",
"logs/",
"vault.json",
"dist/",
"assets/"
],
"compilerOptions": {
"rootDit": "src",
"outDir": "dist"
}
}
// src/index.ts
//'runtime' is a 'global' object equivalent
import { eds } from "@eds-fw/framework";
import { ApplicationCommandType } from "discord.js";
import { token } from "../vault.json" with { "type": "json" };
const config: eds.ConfigExemplar = {
token,
intents: "all",
commandsPath: "./commands/",
slashOnly: true, //default value
includeBuiltinCommands: {
help: true, //default value
},
colors: {
default: 0xffffff, //'0x' + HEX color without '#'
info: 0x00FFEA,
},
};
const bot = eds.createBot(config);
eds.createSlashCommand({
name: "cake",
description: "Give me a cake!",
nsfw: false,
type: ApplicationCommandType.ChatInput,
defaultMemberPermissions: null,
dmPermission: false,
});
eds.startBot();
export default bot;
/cake command:// src/commands/cake.ts
import { eds } from "@eds-fw/framework";
import { ComponentType, ButtonStyle } from "discord.js";
//eds components are resistant to bot restarts
eds.createButton({
custom_id: "get cake"
}, async context => { //"get cake" button code
await context.quickReply(
true, //epemeral?
undefined, //title
"# :cake:" //description
);
})
export default {
async run(context)
{
await context.reply(
true, //ephemeral?
"aloha hawaii", //embed title (optional if has desc)
`<@${context.user.id}>, do you want a cake?`, //embed desc (optional if has title)
"info", //?embed color name (set in config)
[{ //?djs components
type: ComponentType.ActionRow,
components: [{
type: ComponentType.Button,
style: ButtonStyle.Secondary, //gray
custom_id: "get cake",
label: "Get cake"
}]
}]
);
},
//command options
info: {
name: "cake",
type: "slash",
//for auto-help:
desc: "Give me a cake!",
category: "General",
usage: '',
hidden: true,
}
} satisfies eds.CommandFile<"slash">;
start.bat file (WINDOWS ONLY) for easily compile & launch your bot:rem start.bat
@npx tsc
@node dist/index.js
@pause
rem "@pause" keeps window open after bot crash
start.sh file for easily compile & launch your bot:# start.sh
npx tsc
node dist/index.js
read -p "" #keeps window open after bot crash
start.bat or start.sh file. Voila! It's alive!@eds-fw/utils@eds-fw/storage@eds-fw/fetchcreateBot (config: ConfigExemplar): KnownRuntimeProperties (lazyConstructor)createButton (options: ButtonOptions, code: ButtonCode): void (lazyConstructor)
- runtime:
componentManager
createMenu (options: MenuOptions, code: MenuUserCode | MenuStringCode): void (lazyConstructor)
- runtime:
componentManager
createModal (options: ModalOptions, code: ModalCode): void (lazyConstructor)
- runtime:
componentManager
createSlashCommand (options: SpplicationCommandData): void (lazyConstructor)
- runtime:
slashCommandsManager
sfUser (mng_or_ctx: AnyContext | UserManager | undefined, id: Snowflake | undefined): Promise<User | undefined>sfMember (mng_or_ctx: AnyContext | GuildMemberManager | undefined, id: Snowflake | undefined): Promise<GuildMember | undefined>sfChannel (mng_or_ctx: AnyContext | GuildChannelManager | undefined, id: Snowflake | undefined): Promise<GuildBasedChannel | undefined>sfGuild (mng_or_ctx: AnyContext | GuildManager | undefined, id: Snowflake | undefined): Promise<Guild | undefined>sfRole (mng_or_ctx: AnyContext | RoleManager | undefined, id: Snowflake | undefined): Promise<Role | undefined>sfMessage (mng_or_ctx: AnyContext | MessageManager | undefined, id: Snowflake | undefined): Promise<Message | undefined>getAvatar (user: <any user> | <any member> | undefined | null): stringquickEmbed (title?: string, description?: string, type: string = "default", components?: BaseMessageOptions["components"], customEmbed?: JSONEncodable<APIEmbed> | APIEmbed): BaseMessageOptionsoptionsWithDefaultValue (options: SelectMenuComponentOptionData[], defaultVal: string | null): SelectMenuComponentOptionData[]startBot (): Promise<void>
- runtime:
slashCommandsManager, client, config
runtimeStorage (runtime)
[key: string]: anygetAll <T>(...keys: (keyof T)): Tget <V>(key: string): VsetAll <T>(values: T): Tset <K, V>(key: K, value: V): { [X in K]: V }
Client extends djs.Client
- constructor
(options: Options)- async
init (): Promise<void>
Handler
- runtime:
config, loader, client, contextFactory- constructor
new ()
InteractivePanel <T>
- static
register <T extends object>(messageConstructor: InteractivePanel.ConstructMessageFn<T>, msgId: string): void- static
getMenu<T extends object>(msgId: string): InteractivePanel<T> | undefined- static
renderValues(keysAndValues: [string, string | undefined, string?][]): stringdata: Partial<T>render (): MessageCreateOptions & InteractionUpdateOptions & InteractionReplyOptionsdeleteInstance (): void- private constructor
()
Loader
- field
commandHelp: AutoCommandHelp- constructor
new (path: string, noLog?: boolean, ignorePrefixes?: string[], builtinCommands?: ConfigExemplar.includeBuiltinCommands)clearMaps (): void- async
load (): Promise<void>- iternal async
loadBuiltin (): Promise<void>- iternal get
getCallMap: Map<string[], string>- iternal get
getSlashCallMap: Map<string, string>- iternal get
getAlwaysCallMap: string[]- iternal get
getHelpInfoMap: Map<string[], CommandHelpInfo>
SlashCommandsManager
- runtime:
clientcreate (options: djs.ApplicationCommandData): voidsave (): void
SupportedInteractionsCommandContext <CmdType>AnyContextInteractionContext <SupportedInteractions>SlashCommandContextTextCommandContextCommandFileCommandHelpInfoCommandInfoConfigExemplarKnownRuntimePropertiesexpandDirs (path: string): Promise<string[]>AutoCommandHelp
- runtime:
config- field
pages: Map<string, string>- field
commandTypes: Map<string, "slash" | "text" | "nonPrefixed">- field
descriptions: Map<string, string>- field
templates: {...}- field
_fullCommandList: string- constructor
new ()getCommandList (roles: string[]): stringgetCommandNames (roles: string[]): string[]getBakedCommandNames (roles: string[]): string[]clear (): void- iternal
reg (file: CommandFile<boolean> as const): void- iternal field
_publicCommands: string- iternal field
_fullCommandList: string
ContextFactory
- runtime:
config- constructor
new ()createTextContext (message: djs.Message): CommandContext<false>createSlashContext (interaction: djs.ChatInputCommandInteraction): CommandContext<true>
ComponentsManager
- constructor
()emptyclearMaps (): voidcreateButton (options: ButtonOptions, code: ButtonCode): voidcreateMenu (options: MenuOptions, code: MenuUserCode | MenuStringCode): voidcreateModal (options: ModalOptions, code: ModalCode): void- iternal get
getButtonsMap: Map<string, MapVal<...>>- iternal get
getMenusMap: Map<string, MapVal<...>>- iternal get
getModalsMap: Map<string, MapVal<...>>
FAQs
Simply TypeScript framework for your discord.js bot
The npm package @eds-fw/framework receives a total of 55 weekly downloads. As such, @eds-fw/framework popularity was classified as not popular.
We found that @eds-fw/framework demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.