6.0 KiB
Deploying the Mirai Messaging Platform
This document provides only the basic steps. For detailed operations, troubleshooting, and the latest information, please visit the Mirai Official Repository and the Mirai Official Forum.
::: warning
This messaging platform is unstable. Do not use it.
:::
Preparation
Note: Due to the diverse and complex network environments, many steps may require the use of network magic. Those who understand will know.
-
Create a Folder
Create a new folder on any drive (D, E, F, etc.), for example, name it
qqbot. -
Create Subfolders
Double-click to enter the newly created folder, and create two subfolders (it is recommended to keep the names consistent):
miraiandLangBot.
Installing mirai-console
Download the corresponding version of the installer from the mcl-installer releases page. Find the latest installer, which is marked with "Latest," click show all 14 assets, and download mcl-installer-X.X.X-windows-amd64.exe. For example, download mcl-installer-1.0.7-windows-amd64.exe and save it in the previously created mirai folder.
Double-click to open it and press Enter all the way. Then, you will see some additional files.
Continue by clicking mcl.cmd. If you cannot see the file extension, refer to this article to display file extensions: How to View File Extensions.
After double-clicking, an interface similar to the one below will appear. When Enter to continue appears, press Enter.
When the green text appears, the installation is complete. At this point, type exit and press Enter to quit.
Installing mirai-api-http
Open mcl.cmd, enter mcl --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin, and press Enter.
Open mcl.cmd again, press Enter all the way until it exits.
Open mcl.cmd once more, and if you see the following interface, it means the installation was successful.
Press Ctrl+C to exit.
Locate the mira/config/net.mamoe.mirai-api-http/setting.yml file, right-click, and open it with Notepad.
Delete all the content and replace it with:
adapters:
- ws
debug: true
enableVerify: true
verifyKey: yirimirai
singleMode: false
cacheSize: 4096
adapterSettings:
ws:
host: localhost
port: 8080
reservedSyncId: -1
Open mcl.cmd again, and you should see the following output:
This indicates that mirai-api-http has been successfully installed.
Configuring the Signature Service
Download the qsign one-click signature package from this link. Click to download the latest zip file, such as qsign-1.2.1-beta-dev-d62ddce-all.zip [as of December 19, 2023]. Click here to go to the download page.
After downloading, extract the files to get the following:
Copy the two files into the mirai folder.
Open the txlib folder and note the folder with the largest number.
Then, double-click to run mcl.cmd. After a while, when you see the prompt mirai-console started successfully, qsign is installed.
Next, open the config.yml file located in mirai/config/top.mrxiaom.qsign with Notepad.
Then, press Ctrl+S to save.
Double-click to run mcl.cmd again, and you should see a similar prompt, as shown below:
Running Mirai
At this point, you have successfully installed and configured everything. Next, you can log in with your bot's QQ account.
Enter the following, replacing 123456 with your bot's QQ number and 67890 with your bot's QQ password:
login 12345 67890
Then, you will see the following prompt:
Copy the link after Captcha link: and open it in Chrome or Edge. Press F12 to open the developer tools.
Open the Network tab.
Complete the verification in the browser. In the Network tab, find the request named cap_union_new_verify at the bottom.
The content after ticket is what you need to input back into Mirai, but do not include the quotes at the beginning and end.
Note
- Remember to delete the quotes (
", one at the beginning and one at the end) when copying; they are not part of the ticket content. - Be quick.
- Make sure not to miss any characters (the content is long, so ensure you copy everything).
Paste the copied content into the terminal running Mirai.
Then press Enter. If you're lucky, you will be prompted to enter a verification code. Type yes and press Enter, then enter the verification code and press Enter to log in successfully.
If you're unlucky and encounter error code 237, it is recommended to try with a different account.
Next Steps
Check the configuration information page and connect via the YiriMirai adapter.















