New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

crossbuild

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crossbuild

A powerful framework to create cross-platform Discord and Guilded bots

Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
5
400%
Maintainers
3
Weekly downloads
 
Created
Source
CrossBuild Logo

CrossBuild

Installation

To install this package, you can use one of the following commands, depending on your package manager.

npm install crossbuild
pnpm add crossbuild
yarn add crossbuild

If you are connecting your bot to Discord, you will likely need Discord.js as well.

npm install discord.js

If you are connecting your bot to Guilded, you will likely need Guilded.js as well.

npm install guilded.js

Usage

CrossBuild is a library that allows you to build bots for Discord and Guilded, at the same time. It is designed to be as simple as possible, while still being powerful. Here is a simple example of a CrossBuild bot in Typescript:

// src/index.ts
import { CrossBuild, LogLevel } from "crossbuild"

new CrossBuild({
	name: "Test Bot",
	componentPaths: ["/src/components"],
	discordOptions: {
		intents: ["Guilds", "GuildMessages", "MessageContent"]
	},
	guildedOptions: {
		token: process.env.GUILDED_TOKEN
	},
	discordToken: process.env.DISCORD_TOKEN,
	prefix: "-"
})

// src/components/ping.ts
import { Component, CrossBuild, ReceivedInteraction } from "crossbuild"

export default class Cmd extends Component {
	constructor(client: CrossBuild) {
		super("ping", "command", client, {
			description: "Ping!"
		})
	}

	public override async run(interaction: ReceivedInteraction) {
		await interaction.reply({
			content: `Pong`
		})
	}
}

Contributing

If you want to contribute to CrossBuild, please read the contributing guidelines first. We welcome all types of contributions, from bug fixes to documentation improvements! If you have any questions, feel free to join our Discord server and ask in the #crossbuild channel.

License

CrossBuild is licensed under the MIT License.

FAQs

Package last updated on 24 Aug 2023

Related posts