net.dv8tion.jda.api.hooks.ListenerAdapter Java Examples

The following examples show how to use net.dv8tion.jda.api.hooks.ListenerAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Shard.java    From MantaroBot with GNU General Public License v3.0 5 votes vote down vote up
public Shard(int id) {
    this.id = id;
    this.listener = new ListenerAdapter() {
        @Override
        public synchronized void onReady(@Nonnull ReadyEvent event) {
            jda = event.getJDA();
            if (statusChange != null) {
                statusChange.cancel(true);
            }

            statusChange = MantaroBot.getInstance().getExecutorService()
                    .scheduleAtFixedRate(Shard.this::changeStatus, 0, 10, TimeUnit.MINUTES);
        }
    };
}
 
Example #2
Source File: DiscordBotServer.java    From MtgDesktopCompanion with GNU General Public License v3.0 5 votes vote down vote up
private void initListener()
{
	listener = new ListenerAdapter() {
		
		
		@Override
		public void onMessageReceived(MessageReceivedEvent event)
		{
			if (event.getAuthor().isBot()) 
				return;
			analyseCard(event);
		}
	};
}