Skip to content

Client.spread()

github-actions[bot] edited this page Sep 30, 2024 · 14 revisions

spreads out data over another directory if you want to have commands in a separate folder

spread tasks are stored in Client.spreads and they're ran when the client logs in

Function Sync

Arguments:

  • directory String
    directory you want to spread to

  • ?data Array
    arguments you want to spread with it
    defaults to just the client if not given

  • ?ignore Array
    files to ignore in the directory
    automatically contains index.js and index.ts

  • ?action Function
    what the spread does internally with the stuff
    don't change if you don't know what you're doing



JS (index.js)
client.spread("src/commands");                     
JS (src/commands/ping.js)
module.exports = (client) => {	

    client.import("commands", "app", "components");

    commands.create("ping", "replies with pong", (ctx) => {
	let timestamp = new Timestamp();

	let embed = new Embed({
		header: "Pong!",
		timestamp: timestamp.embed,
		color: app.colors.blurple,
		footer: `latency: ${timestamp.latency(ctx)}ms`
	});

	ctx.reply({ embeds: [embed] });
    });
	
}


🛈 Client

🛈 AddonService

🛈 AttachmentService

🛈 ChannelService

🛈 CommandService

🛈 ComponentService

🛈 ErrorService

🛈 EventService

🛈 ExpressionService

🛈 GuildService

🛈 LogService

🛈 MessageService

🛈 PermissionService

🛈 RoleService

🛈 StorageService

🛈 TypeService

🛈 UserService

🛈 UtilService

🛈 VoiceService


Clone this wiki locally