本文整理汇总了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);
}