DiSkyOrg / DiSky

The best Skript add-on for Discord management! Slash commands, interaction, components, modal and much more available!
https://disky.me/
Apache License 2.0
42 stars 12 forks source link

"message receive" event is fired twice #215

Closed softy-oniguru closed 2 months ago

softy-oniguru commented 2 months ago

Versions

Description

on message received:
    broadcast event-bot
    event-user is not bot
    broadcast "&7%event-user's discord id%: %event-message%"

its returns message 2 times:

[22:51:56 INFO]: (my bot)
[22:51:56 INFO]: 757970149553995788: test
[22:51:56 INFO]: (my bot)
[22:51:56 INFO]: 757970149553995788: test

Acknowledgment

softy-oniguru commented 2 months ago

I have already tried to ask for help in the discord, but I have already checked everything myself.

softy-oniguru commented 2 months ago

the current way to remove this bug is:

  1. Add the discord id of the message to the list
  2. Check => remove discord id from the list, stop
    on message receive:
    if {.::*} contains event-message's discord id:
    remove event-message's discord id from {.::*}
    stop
    add event-message's discord id to {.::*}
EquipableMC commented 2 months ago

You are wrong. Use the following the code below:

on message receive:
    discord id of event-channel is "id"
    event-member is not a discord bot
    broadcast "%event-member %event-message%"