mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-09 13:03:37 +08:00
17 lines
472 B
TypeScript
17 lines
472 B
TypeScript
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
|
import { ActionName } from '@/napcat-onebot/action/router';
|
|
|
|
export class GetCSRF extends OneBotAction<void, { token: number }> {
|
|
override actionName = ActionName.GetCSRF;
|
|
|
|
async _handle () {
|
|
const sKey = await this.core.apis.UserApi.getSKey();
|
|
if (!sKey) {
|
|
throw new Error('SKey is undefined');
|
|
}
|
|
return {
|
|
token: +this.core.apis.WebApi.getBknFromSKey(sKey),
|
|
};
|
|
}
|
|
}
|