Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot acting as a normal user and not bridging messages between Matrix and Discord #882

Open
DALHOUM-Ahmed opened this issue Apr 29, 2023 · 1 comment

Comments

@DALHOUM-Ahmed
Copy link

DALHOUM-Ahmed commented Apr 29, 2023

I've set up matrix-appservice-discord to bridge messages between a Matrix room and a Discord channel. However, the bot is only acting as a normal user and not forwarding messages between the two platforms.

Here's what I've done so far:

  1. Set up Synapse homeserver and matrix-appservice-discord.
  2. Configured the config.yaml file with the correct Matrix room ID, Discord guild ID, and Discord channel ID.
  3. Ensured that the bot has the necessary permissions on both Matrix and Discord.

Despite following the setup instructions, I am experiencing the following issues:

  1. The bot can only interact as a normal user, not as a bridge bot.
  2. When sending messages, the logs show a warning about the Matrix room not being found (Room(s) not found.).
  3. The bot is listening successfully to the Discord channel, but the logs indicate that the Matrix room is not being found.
    To investigate further, I added console logs in the GetRoomIdsFromChannel function in the channelsyncroniser.ts file:
public async GetRoomIdsFromChannel(
    channel: Discord.Channel
  ): Promise<string[]> {

    const rooms = await this.roomStore.getEntriesByRemoteRoomData({
      discord_channel: channel.id,
    });

    console.log("channel.id", channel.id);

    console.log("rooms", rooms);

    if (rooms.length === 0) {

      log.verbose(`Couldn't find room(s) for channel ${channel.id}.`);

      return Promise.reject("Room(s) not found.");

    }
    return rooms.map((room) => room.matrix!.getId() as string);

  }

Here's a sample of the logs when I start typing in my Discord room:

warning ../../../package.json: No license field

$ yarn build && node ./build/src/discordas.js -c config.yaml

warning ../../../package.json: No license field

$ tsc

channel.id 1100388067380056165

rooms []

Apr-29 18:09:49.294 [DiscordBot] warn: Exception thrown while handling "typingStart" event Room(s) not found.

I would appreciate any guidance on how to resolve this issue and get the bot to successfully bridge messages between Matrix and Discord.

@iameli
Copy link

iameli commented Jul 16, 2023

Running into something very similar with the Room(s) not found message. Any luck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants