Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventWaiter doesn't handle consistently GuildMemberJoinEvent #97

Closed
ghost opened this issue Nov 22, 2019 · 2 comments
Closed

EventWaiter doesn't handle consistently GuildMemberJoinEvent #97

ghost opened this issue Nov 22, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 22, 2019

Hi I am using the event waiter like this:

waiter.waitForEvent(GuildMemberJoinEvent::class.java, {true}) {
        rootLogger.info(it.member.effectiveName)

        val welcomeMessage = "Welcome!"
        it.member.guild.getTextChannelById(config.getLong("config.inviteChannelId"))!!.sendMessage(welcomeMessage).queue()
}

But sometimes the message does not appear in the channel, I suspect the EventWaiter is buggy and it doesn't trigger. Any idea?

@ghost ghost changed the title EventWaiter doesn't work EventWaiter doesn't handle consistently GuildMemberJoinEvent Nov 22, 2019
@Andre601
Copy link
Contributor

Why do you use JDA-Utilities for something that is in JDA?
Just listen for the GuildMemberJoinEvent and send a message then. Using an EventWaiter for this seems really out of place.

@jagrosh
Copy link
Member

jagrosh commented Nov 22, 2019

The event waiter only waits for an event one time, as per its documentation. To activate again, you'd need to wait again, but as noted, it seems like you should be using an Event Listener, not an Event Waiter.

@jagrosh jagrosh closed this as completed Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants