mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-25 06:50:09 +08:00
Add more examples
This commit is contained in:
parent
9d4e0d053f
commit
2eaf4d5f54
@ -8,11 +8,26 @@ import net.mamoe.mirai.message.GroupMessage;
|
||||
import net.mamoe.mirai.message.data.At;
|
||||
import net.mamoe.mirai.message.data.Image;
|
||||
import net.mamoe.mirai.message.data.MessageUtils;
|
||||
import net.mamoe.mirai.utils.BotConfiguration;
|
||||
import net.mamoe.mirai.utils.SystemDeviceInfoKt;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
class BlockingTest {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
BlockingBot bot = BlockingBot.newInstance(123456, "");
|
||||
// 使用自定义的配置
|
||||
BlockingBot bot = BlockingBot.newInstance(123456, "", new BotConfiguration() {
|
||||
{
|
||||
setDeviceInfo(context ->
|
||||
SystemDeviceInfoKt.loadAsDeviceInfo(new File("deviceInfo.json"), context)
|
||||
);
|
||||
setHeartbeatPeriodMillis(50 * 1000);
|
||||
}
|
||||
});
|
||||
|
||||
// 使用默认的配置
|
||||
// BlockingBot bot = BlockingBot.newInstance(123456, "");
|
||||
|
||||
bot.login();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user