Frogperson / Emoji-Roles

A discord bot to allow members to toggle roles by reacting on messages
2 stars 0 forks source link

Bot not reacting? #2

Open Dinip opened 5 years ago

Dinip commented 5 years ago

I've linked an emoji to a role and set a role message... Shouldn't the bot react to that message? Thanks

image

{ "messageIds": [ 536339839075876874 ], "emojiRoles": { "\u0026#127752;": "536258186999758851" } }

Dinip commented 5 years ago

`SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder". SLF4J: Defaulting to no-operation MDCAdapter implementation. SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details. [main] INFO JDA - Login Successful! [JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket [JDA MainWS-ReadThread] INFO JDA - Finished Loading!

This bot is running on the following servers:`

Frogperson commented 5 years ago

Your Role Message needs to have the emoji in it in order for the bot to react. That way you can have multiple Role Messages each with different reactions. Try editing your Role Message to say something like this: image

Dinip commented 5 years ago

Ok nice got it to work! But should the reaction stay until I want to remove the role? I've seen on other bots that you react and get the role, then you remove the reaction if you don't want the role anymore. Also I have refreshReactions = false but the bot seems to keep refreshing and getting [JDA RateLimit-Worker 1] WARN RateLimiter - Encountered 429 on route /channels/123456789123456789/messages/{message_id}/reactions/{reaction_code}/@me

Frogperson commented 5 years ago

Nope the reaction doesn't stay, it's a toggle. You react once to get the role, and then react again to remove it. I thought about having it like you said but ultimately decided against it.

The refreshReactions = false seems to be a bug. I'll fix it in my next release but until then I have two workarounds for you. You can either give it a valid bot token for refreshBotToken and keep refreshReactions = false, or set the refreshTimer to something ridiculously high (but don't go over 2,147,483,647).

The [JDA RateLimit-Worker 1] WARN RateLimiter - Encountered 429 on route is unfortunately a problem with JDA (the Discord API library I used) and isn't something I can fix. It'll spam your console a bit at times but shouldn't be an issue otherwise.