hburn7 / BanchoSharp

C# library for communicating with osu!Bancho
GNU General Public License v3.0
11 stars 2 forks source link

Events firing twice #52

Closed mrmagic223325 closed 2 months ago

mrmagic223325 commented 2 months ago
public static async Task Main()
    {
        string username = "mr_magic223325";
        string password = "";
        IBanchoClient client = new BanchoClient(new BanchoClientConfig(new IrcCredentials(username, password), isBot: true));

        client.OnPrivateMessageReceived += Console.WriteLine;

        await client.ConnectAsync();
    }

If I send a message to BanchoBot the reply from it will fire the OnPrivateMessageReceived event twice. image

matte-ek commented 2 months ago

I can reproduce, seems to be a possible oversight from 13c59f7? Although I think Stage (repo owner) is using this version in his Brigitta application where I assume it's working fine. I should probably be dogfooding the library as well but I am on a slightly older version.

EDIT: Seems to be only used for alerts and such in Brigitta, possibly called twice there as well.

hburn7 commented 2 months ago

Will look into this, thanks.

hburn7 commented 2 months ago

Reproduced

hburn7 commented 2 months ago

I can reproduce, seems to be a possible oversight from 13c59f7? Although I think Stage (repo owner) is using this version in his Brigitta application where I assume it's working fine. I should probably be dogfooding the library as well but I am on a slightly older version.

EDIT: Seems to be only used for alerts and such in Brigitta, possibly called twice there as well.

Yeah, I think that's it.