Type-safe, well-documented libraries for 6 languages. Full REST API coverage, WebSocket gateway, bot framework, and OAuth helpers. Install in seconds.
npm install @collaborix/sdkyarn add @collaborix/sdkimport { CollaborixBot } from '@collaborix/sdk';
const bot = new CollaborixBot({
token: process.env.BOT_TOKEN,
intents: ['messages', 'reactions'],
});
bot.command('/hello', async (ctx) => {
await ctx.reply({ text: `Hello, ${ctx.user.name}!` });
});
bot.on('message.created', async (event) => {
console.log(`${event.author.name}: ${event.content}`);
});
bot.start();pip install collaborixpoetry add collaboriximport collaborix
bot = collaborix.Bot(token="YOUR_BOT_TOKEN")
@bot.command("/hello")
async def hello(ctx):
await ctx.reply(f"Hello, {ctx.user.name}!")
@bot.on("message.created")
async def on_message(event):
print(f"{event.author.name}: {event.content}")
bot.run()go get github.com/collaborix/go-sdkpackage main
import (
"fmt"
"os"
collaborix "github.com/collaborix/go-sdk"
)
func main() {
bot := collaborix.NewBot(os.Getenv("BOT_TOKEN"))
bot.Command("/hello", func(ctx *collaborix.CommandCtx) {
ctx.Reply(fmt.Sprintf("Hello, %s!", ctx.User.Name))
})
bot.On("message.created", func(e *collaborix.MessageEvent) {
fmt.Printf("%s: %s\n", e.Author.Name, e.Content)
})
bot.Start()
}implementation 'com.collaborix:sdk:1.0.0'<!-- Maven -->
<dependency>
<groupId>com.collaborix</groupId>
<artifactId>sdk</artifactId>
<version>1.0.0</version>
</dependency>import com.collaborix.sdk.*;
public class MyBot {
public static void main(String[] args) {
var bot = CollaborixBot.builder()
.token(System.getenv("BOT_TOKEN"))
.intents(Intent.MESSAGES, Intent.REACTIONS)
.build();
bot.onCommand("/hello", ctx -> {
ctx.reply("Hello, " + ctx.getUser().getName() + "!");
});
bot.onEvent(MessageCreated.class, event -> {
System.out.printf("%s: %s%n",
event.getAuthor().getName(),
event.getContent());
});
bot.start();
}
}dotnet add package Collaborix.SDKInstall-Package Collaborix.SDKusing Collaborix.SDK;
var bot = new CollaborixBotBuilder()
.WithToken(Environment.GetEnvironmentVariable("BOT_TOKEN"))
.WithIntents(Intent.Messages | Intent.Reactions)
.Build();
bot.OnCommand("/hello", async ctx =>
{
await ctx.ReplyAsync($"Hello, {ctx.User.Name}!");
});
bot.OnEvent<MessageCreated>(async e =>
{
Console.WriteLine($"{e.Author.Name}: {e.Content}");
});
await bot.StartAsync();cargo add collaborix-sdk[dependencies]
collaborix-sdk = "0.5"use collaborix_sdk::{Bot, Context, Event};
#[tokio::main]
async fn main() {
let bot = Bot::new(std::env::var("BOT_TOKEN").unwrap())
.intents(&["messages", "reactions"])
.build();
bot.command("/hello", |ctx: Context| async move {
ctx.reply(format!("Hello, {}!", ctx.user.name)).await
});
bot.on_event(|event: Event| async move {
if let Event::MessageCreated(msg) = event {
println!("{}: {}", msg.author.name, msg.content);
}
});
bot.start().await.unwrap();
}