Dragory / modmailbot

Modmail Bot is a bot for Discord that makes it easier for users to contact moderators and admins for help.
MIT License
709 stars 704 forks source link

Having mail and main guild as the same server seems to break pingOnBotMention #134

Closed SamFeniks closed 6 years ago

SamFeniks commented 6 years ago

Hi!

I actually did some testing on this one.

Scenario A: bot is in two seperate servers. Server 1 is mainguild, server 2 is mailguild. user in server 1 pings bot. bot pings assigned role in server 2 log channel, to notify that the bot was pinged.

scenario B: bot is in one server. Mainguild and Mailguild are set to the same server using a private category. user in server pings the bot, but nothing happens in the log channel.

what giveS?

SamFeniks commented 6 years ago
{
  "token": "",
  "mailGuildId": "114407194971209731",
  "mainGuildId": "114407194971209731",
  "logChannelId": "483589793586872322",
  "alwaysReplyAnon": "true",
  "status": "Message me for help!",
  "responseMessage": "Thank you for your message! Our mod team will reply to you here as soon as possible.",
  "newThreadCategoryId": "483588684621545523",
  "threadTimestamps": "true",
  "typingProxy": "false",
  "mentionRole": "here",
  "pingOnBotMention": "true",
  "inboxServerPermission": "kickMembers",
  "typingProxyReverse": "false",
  "requiredAccountAge": "1",
  "accountAgeDeniedMessage": "Your Discord account is not old enough to contact modmail.",
  "port": "8891"
}
Dragory commented 6 years ago

Ah, good catch. At the moment this is intentional so mod pings of ModMail (to e.g. direct users to use it) don't create notifications on the inbox server. I'll add some additional checks for same server setups soon.

JonasPardon commented 6 years ago

This works for me though, I'm running a one-server setup and it does notify us on ping.

I'm still running an older version though, did you disable this after the closeMessage update?

Dragory commented 6 years ago

The piece of code that ignores pings from users that are on the inbox server is really old (you can see it here: https://github.com/Dragory/modmailbot/blob/master/src/main.js#L152). If it does notify you even on a single-server setup, the bot probably didn't have the guild member cached for some reason (though it definitely should).

slothonmeth commented 6 years ago

Hi, I'm also having this issue, do you have time to fix it?

Dragory commented 6 years ago

This should be fixed in v2.17.0