generated from array-in-a-matrix/matrix-bot-template
delete js index file - this is now the compiled output
This commit is contained in:
parent
6dd7d91321
commit
434652eb5c
1 changed files with 0 additions and 25 deletions
25
index.js
25
index.js
|
@ -1,25 +0,0 @@
|
|||
import config from './config.json' assert {type: "json"};
|
||||
import { MatrixClient, SimpleFsStorageProvider, AutojoinRoomsMixin, RichRepliesPreprocessor } from "matrix-bot-sdk";
|
||||
|
||||
const storage = new SimpleFsStorageProvider("storage.json");
|
||||
const client = new MatrixClient(config.homeserver, config.token, storage);
|
||||
|
||||
AutojoinRoomsMixin.setupOnClient(client);
|
||||
client.addPreprocessor(new RichRepliesPreprocessor(false));
|
||||
client.start().then(() => console.log(`Client has started!`));
|
||||
|
||||
// ? event listener
|
||||
client.on("room.message", (roomId, event) => {
|
||||
// ? check if the message's text is not empty and isn't sent by the bot itself
|
||||
if (! event["content"] || event["sender"] === config.user) return;
|
||||
const message = event["content"]["body"].toLowerCase();
|
||||
// ? if message starts with the bot's <prefix + command> then execute the command
|
||||
if (message.startsWith(config.prefix + "COMMAND")){
|
||||
|
||||
//
|
||||
// TODO: START CODE HERE
|
||||
//
|
||||
|
||||
}
|
||||
})
|
||||
|
Loading…
Add table
Reference in a new issue