XVE needs polyfills to work with your specific library. It is based around the discord.js library, but has been abstracted away so it doesn’t rely on any particular library and can be easily polyfilled to fit your sdk.
Events are as written in the Discord documentation, except for the following rules:
guild_id, message_id, channel_id
would become (GuildObject, ChannelObject, MessageObject)
in the callback.Async is not supported. The then
callback is used for everything.
Instead of await channel.send()
its, channel.send().then(callback);
Expected functions and their parameters:
Function | Parameters | D.JS Equiv |
---|---|---|
sendMessage | Channel / Snowflake, String | channel.send(string) |
TODO: Implement more of these
Objects passed to graphs are expected to match the Discord API’s responses. There are some rules to govern how objects should look and behave:
guild_id
should be a guild
that returns a guild object.XVE requires some system-related polyfills, to make it easier and more cross-compatiable with different platforms.
It also provides a collection of utility functions such as a wait(duration : number) : Promise<void>
.
It can be found at the system.mjs