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:
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: "-"
})
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.