本文整理匯總了Java中net.dv8tion.jda.core.hooks.ListenerAdapter類的典型用法代碼示例。如果您正苦於以下問題:Java ListenerAdapter類的具體用法?Java ListenerAdapter怎麽用?Java ListenerAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ListenerAdapter類屬於net.dv8tion.jda.core.hooks包,在下文中一共展示了ListenerAdapter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerEventListeners
import net.dv8tion.jda.core.hooks.ListenerAdapter; //導入依賴的package包/類
public void registerEventListeners(JDABuilder jda) {
if (!classLoader.getPlugin().getEventListeners().isEmpty()) {
for (ListenerAdapter adapter : classLoader.getPlugin().getEventListeners()) {
jda.addEventListener(adapter);
}
}
}
示例2: JDA3Handler
import net.dv8tion.jda.core.hooks.ListenerAdapter; //導入依賴的package包/類
/**
* Creates a new instance of this class.
*
* @param jda A JDA instance.
*/
public JDA3Handler(JDA jda) {
jda.addEventListener(new ListenerAdapter() {
@Override
public void onMessageReceived(MessageReceivedEvent event) {
handleMessageCreate(event);
}
});
}
示例3: getEventListeners
import net.dv8tion.jda.core.hooks.ListenerAdapter; //導入依賴的package包/類
/**
* Gets a set of the event listeners that has been registered by the plugin.
*
* @return A set of registered event listeners.
*/
final Set<ListenerAdapter> getEventListeners() {
return eventListeners;
}
示例4: registerEventListener
import net.dv8tion.jda.core.hooks.ListenerAdapter; //導入依賴的package包/類
/**
* Registers a JDA event listener, the class must extend from the {@link ListenerAdapter Abstract Listener Adapter}.
*
* @param listener The event listener that should be registered.
*/
public void registerEventListener(ListenerAdapter listener) {
eventListeners.add(listener);
}