Skip to content

Can't run sendMessage function from outside mumble.connect #96

@sh1omi

Description

@sh1omi

Here is part of my code:

let MumbleClient;
mumble.connect( 'mumble://localhost', options, (error,client) => {
    if( error ) { throw new Error( error ); }
    client.authenticate( 'sh1bot' );

    client.on( 'initialized', () => {
        console.log('Connected to Mumble');
    });

    client.on('message', (message,user,scope) => {
        if(user.name != "sh1bot") MatrixClient.sendTextMessage("!iYtzSBNGLHCIxfsRpO:matrix.org", user.name+": "+message);
    });

    MumbleClient = client;
});

When I trying to do MumbleClient.sendMessage from outside mumble.connect it show this error:

Caught /sync error TypeError: Cannot read property 'sendMessage' of undefined
    at MatrixClient.CreateClient.MatrixClient.on (/home/sh1omi/Desktop/BridgeBot/index.js
:73:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions