How to use the matrix-bot-sdk.PantalaimonClient function in matrix-bot-sdk

To help you get started, we’ve selected a few matrix-bot-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matrix-org / mjolnir / src / index.ts View on Github external
(async function () {
    const storage = new SimpleFsStorageProvider(path.join(config.dataPath, "bot.json"));

    let client: MatrixClient;
    if (config.pantalaimon.use) {
        const pantalaimon = new PantalaimonClient(config.homeserverUrl, storage);
        client = await pantalaimon.createClientWithCredentials(config.pantalaimon.username, config.pantalaimon.password);
    } else {
        client = new MatrixClient(config.homeserverUrl, config.accessToken, storage);
    }

    if (config.autojoin) {
        AutojoinRoomsMixin.setupOnClient(client);
    }

    const banLists: BanList[] = [];
    const protectedRooms: { [roomId: string]: string } = {};

    const joinedRooms = await client.getJoinedRooms();

    // Ensure we're also joined to the rooms we're protecting
    for (const roomRef of config.protectedRooms) {