Commit 2eaf4d5f authored by Him188's avatar Him188

Add more examples

parent 9d4e0d05
...@@ -8,11 +8,26 @@ import net.mamoe.mirai.message.GroupMessage; ...@@ -8,11 +8,26 @@ import net.mamoe.mirai.message.GroupMessage;
import net.mamoe.mirai.message.data.At; import net.mamoe.mirai.message.data.At;
import net.mamoe.mirai.message.data.Image; import net.mamoe.mirai.message.data.Image;
import net.mamoe.mirai.message.data.MessageUtils; 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 { class BlockingTest {
public static void main(String[] args) throws InterruptedException { 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(); bot.login();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment