28 lines
944 B
JavaScript
28 lines
944 B
JavaScript
const sdk = require("matrix-js-sdk");
|
|
const matrixcs = require("matrix-js-sdk/lib/matrix");
|
|
const request = require('request');
|
|
matrixcs.request(request);
|
|
|
|
const startupTime = Date.now();
|
|
|
|
const myUserId = "@glowy:glowers.club"
|
|
const myAccessToken = "syt_TotallyMyRealAccessTokenAndNotAFake";
|
|
const matrixClient = sdk.createClient({
|
|
baseUrl: "https://glowers.club",
|
|
accessToken: myAccessToken,
|
|
userId: myUserId
|
|
});
|
|
|
|
const MorgBully = require('./index.js');
|
|
const morgBully = new MorgBully(matrixClient);
|
|
morgBully.setBlacklistedRooms(["!crybabies:matrix.org", "!peoplewhocanttakeajoke:matrix.org"]);
|
|
morgBully.setInsults(["you're a dummy", "you're going to get banned", "I'll slap you with a fish"]);
|
|
|
|
matrixClient.on("Room.timeline", function(event, room, toStartOfTimeline) {
|
|
if (event.getTs() >= startupTime && event.getType() == "m.room.member") {
|
|
morgBully.handleMembership(event, room);
|
|
}
|
|
});
|
|
|
|
matrixClient.startClient();
|