LittleSpace Network Developers
Sign in

Coming from Discord

Fluxer’s API was designed to feel like Discord’s, so most of your bot’s logic moves over as is. The differences are in how bots connect and in features Fluxer doesn’t have yet.

#What’s the same

  • Communities (Fluxer’s docs call them guilds), channels, roles, members and DMs
  • Message objects: content, author, embeds, mentions, message_reference
  • Embeds, reactions, replies, pins and webhooks
  • Kicks, bans, timeouts and audit log reasons
  • Permission bits. Most have the same values as Discord, but Fluxer adds some, so use fluxkit’s Permissions rather than copying numbers.
  • IDs are snowflake strings

#What’s different

DiscordFluxer
IntentsYou request them, and message content is privilegedThere are none. Bots get every message they can see.
Slash commandsYesNot yet. Use prefix commands like !roll.
Buttons, select menus, modalsYesNot yet
Where the API livesAlways discord.comEach instance has its own. fluxkit finds it from instance.
The guild object on joinFlatThe owner and settings sit under properties. fluxkit flattens it for you.
Reply option fail_if_not_existsYesDoesn’t exist

#The / menu

Typing / in littlespace.chat shows commands like /shrug, /kick and /gif. Those are built into the app. Bots can’t add to that menu yet, so a bot command that only does what a built-in one does doesn’t need porting.

#Porting a discord.js bot

Most changes are mechanical:

discord.jsfluxkit
new Client({ intents: [...] })new FluxerClient({ instance, token })
client.login(token)bot.login()
client.on('messageCreate', fn)bot.on('message', fn)
message.reply('hi')reply('hi') inside a command, or bot.reply(message, 'hi')
message.channel.send('hi')bot.rest.sendMessage(message.channel_id, 'hi')
message.delete()bot.rest.deleteMessage(message.channel_id, message.id)
message.member.permissions.has(...)hasPermission(bot.permissionsFor(message), Permissions.X)
A slash command with optionsA prefix command with args
A buttonA reaction the bot listens for, or a follow-up command

fluxkit gives you plain objects from the API rather than classes, so you read message.author.id and message.channel_id directly.

#Running on both

If you’re moving a community over gradually, you can keep the Discord bot running and add a fluxkit version beside it. The two can share your database and logic, with only the parts that send and receive messages being different.