OnlyInServers does not work properly sometimes #17

Open
opened 2023-10-11 05:18:49 +00:00 by Foxite · 2 comments
Foxite commented 2023-10-11 05:18:49 +00:00 (Migrated from github.com)

I had an item with a probability of 0.001 and an OnlyInServers list with one server. This item has activated 4 times in servers where it was not supposed to activate. When I raise the probability for testing, it does not activate.

I have disabled this item globally until I find out what the problem is

I had an item with a probability of 0.001 and an OnlyInServers list with one server. This item has activated 4 times in servers where it was not supposed to activate. When I raise the probability for testing, it does not activate. I have disabled this item globally until I find out what the problem is
Foxite commented 2023-10-14 16:55:00 +00:00 (Migrated from github.com)

My current theory is that this isn't to do with the item having a probability but because the GuildId is missing from the object when it is received from Discord. The docs say that the guild_id property of a Channel object "may be missing for some channel objects received over gateway guild dispatches" which is of course very clear and useful. I wasn't able to find a specific event that does this, but MessageCreated shouldn't be one of them.

Regardless I've added code to alert a webhook if this appears to be the case.

My current theory is that this isn't to do with the item having a probability but because the GuildId is missing from the object when it is received from Discord. The [docs](https://discord.com/developers/docs/resources/channel) say that the guild_id property of a Channel object "may be missing for some channel objects received over gateway guild dispatches" which is of course very clear and useful. I wasn't able to find a specific event that does this, but MessageCreated shouldn't be one of them. Regardless I've added code to alert a webhook if this appears to be the case.
Foxite commented 2023-10-14 17:17:08 +00:00 (Migrated from github.com)

So I added this item to my config:

    { 
      "Enabled": true,
      "Trigger": {
        "Type": "MessageContent",
        "MessageRegex": ".*",
        "OnlyInServers": [
          942881727527940128 /* invalid */
        ]
      }, 
      "RespondMode": "All", 
      "RespondGroup": "all",
      "Responses": [{
        "Type": "Notification",
        "Response": "<@133798410024255488> this should never happen"
      }]
    },  

It consistently triggers even though there is no server that exists, with that ID. However I did not get the report from the builtin alert.

This stopped happening after I restarted Botsome

So I added this item to my config: ```json { "Enabled": true, "Trigger": { "Type": "MessageContent", "MessageRegex": ".*", "OnlyInServers": [ 942881727527940128 /* invalid */ ] }, "RespondMode": "All", "RespondGroup": "all", "Responses": [{ "Type": "Notification", "Response": "<@133798410024255488> this should never happen" }] }, ``` It *consistently* triggers even though there is no server that exists, with that ID. However I did *not* get the report from the builtin alert. This stopped happening after I restarted Botsome
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Foxite/Botsome#17
No description provided.