Comments (7)
这个是 mirai-core 的问题,正在尝试解决
from mirai-demos.
好的,谢谢,请问使用以前的版本有这个问题吗?
from mirai-demos.
可能可以在1.0-EA2或者1.0-EA中正常
from mirai-demos.
我在另一个Issues中听说是匿名内部类的问题,好像有人已经调出来了,但是我却发生了新的异常
代码如下:
public static class CustomEventListener extends SimpleListenerHost {
@EventHandler
public ListeningStatus onFriendMsg(FriendMessageEvent event) {
MessageReceipt<Contact> receipt = event.getSender().sendMessage("测试测试");
receipt.recallIn(10000);
return ListeningStatus.LISTENING;
}
@Override
public void handleException(@NotNull CoroutineContext context, @javax.validation.constraints.NotNull Throwable exception) {
super.handleException(context, exception);
}
}
public static void main(String[] args) throws InterruptedException {
final Bot bot = BotFactoryJvm.newBot(qq, password, new BotConfiguration() {
{
fileBasedDeviceInfo("deviceInfo.json");
}
});
bot.login();
Events.registerEvents(bot, new CustomEventListener());
bot.join();
}
异常信息:
Exception in thread "main" java.lang.IllegalArgumentException: Kotlin event handlers cannot have nullable parameter type.
at net.mamoe.mirai.event.Events__JvmMethodListenersKt.registerEvent$Events__JvmMethodListenersKt(JvmMethodListeners.kt:298)
at net.mamoe.mirai.event.Events__JvmMethodListenersKt.registerEvents(JvmMethodListeners.kt:233)
at net.mamoe.mirai.event.Events.registerEvents(JvmMethodListeners.kt:1)
at net.mamoe.mirai.event.Events__JvmMethodListenersKt.registerEvents$default(JvmMethodListeners.kt:230)
at net.mamoe.mirai.event.Events.registerEvents$default(JvmMethodListeners.kt:1)
at net.mamoe.mirai.event.Events.registerEvents(JvmMethodListeners.kt)
at Test.main(Test.java:34)
from mirai-demos.
@HappyOnion801 请问这个问题发生时使用的 mirai 版本是多少?
from mirai-demos.
mirai-core-1.1.-EA2
from mirai-demos.
请在 mirai core 已有的issue中继续这类问题的讨论
from mirai-demos.
Related Issues (14)
- demo运行时,接受群信息出错 HOT 3
- 登陆后接收不到消息 log出这个 unknown PbGetMsg type 732 HOT 5
- 请求出一个详细的构建教程 HOT 4
- Events.registerEvent: java.lang.IllegalArgumentException: argument type mismatch HOT 2
- android项目用多少版本的sdk呢 HOT 3
- java.lang.IllegalArgumentException: argument type mismatch HOT 2
- 请问如何撤回一条群员消息 HOT 2
- 请问一下如何实现跨类监听
- 如果可以的话,请问如何发送本地图片呢
- 请问这个怎么运行 HOT 1
- java.lang.IllegalStateException: cannot upload group image, failed on all servers.
- 请更新一下安卓端,现在登陆后输入验证码就不进行了 一直卡在验证码这里也不进入一直换验证码 是协议的问题吧
- 登陆后报这个错误mirai-android-demo HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mirai-demos.