-
Notifications
You must be signed in to change notification settings - Fork 21
Modules
Roj edited this page Aug 9, 2022
·
6 revisions
Reply the module file with the following command:
\install
⚠️ DisclaimerModules you install can have full control of your account. Please be sure that you are installing modules from a trusted source, like the Xor Modules Directory.
In case if something wrong happens, the Xor authors will not be responsible for your carelessness.
\modules
\disable mod1 mod2 mod3
\enable mod1 mod2 mod3
\uninstall mod1 mod2 mod3
A Xor module is a TypeScript file that exports a set of message handlers and a unique name. Any developer can write them easily.
Here’s an simple example:
import { CommandHandler, type Module } from "$xor";
const hello: Module = {
name: "hello",
handlers: new CommandHandler(
"hello",
async ({ event }) => {
await event.message.reply({ message: "Hello you!" });
},
),
};
export default hello;For more information on handlers and types, please refer to the source code for now.
© 2022 Xor contributors. Licensed under Creative Commons.