Feat: 天気予報の分割数を自動的に計算する機能 / Fix: 震度0の地震情報に対応していない問題 / Feat: 最大震度の要求を設定できる機能 / Feat: 最大震度が不明な場合に投稿するかどうかを設定できる機能
This commit is contained in:
+19
-7
@@ -14,6 +14,7 @@ class MemoryClass {
|
||||
lastReadMention: "",
|
||||
lastReadReply: "",
|
||||
userid: "",
|
||||
max_length: 0,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -32,15 +33,26 @@ class MemoryClass {
|
||||
|
||||
const Memory = new MemoryClass();
|
||||
|
||||
export const initUserID = async () => {
|
||||
const response = await client.request("me/");
|
||||
export const initData = async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
const response = await client.request("me/");
|
||||
|
||||
if (!response.success)
|
||||
throw new Error("meの取得に失敗しました");
|
||||
if (!response.success)
|
||||
throw new Error("meの取得に失敗しました");
|
||||
|
||||
const mem = Memory.memory;
|
||||
mem.userid = response.userid;
|
||||
Memory.memory = mem;
|
||||
const mem = Memory.memory;
|
||||
mem.userid = response.userid;
|
||||
Memory.memory = mem;
|
||||
})(),
|
||||
(async () => {
|
||||
const response = await client.request("serverinfo-api");
|
||||
|
||||
const mem = Memory.memory;
|
||||
mem.max_length = response.server_info.max_ueuse_length;
|
||||
Memory.memory = mem;
|
||||
})(),
|
||||
]);
|
||||
}
|
||||
|
||||
export default Memory;
|
||||
Reference in New Issue
Block a user