-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4b7e2b
commit 03e5589
Showing
4 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export async function importEmojiMeta(emoji, host:string) { | ||
emoji.category = '取得失敗'; | ||
try { | ||
const json = await(await fetch('https://' + host + '/api/emoji?name=' + emoji.name)).json(); | ||
emoji.category = ''; | ||
const from_json = (key: string) => { | ||
try { | ||
if (json[key]) { | ||
emoji[key] = json[key]; | ||
} | ||
} catch { | ||
//一部失敗したら転送せず空欄のままにしておく | ||
} | ||
}; | ||
from_json('license'); | ||
from_json('aliases'); | ||
from_json('category'); | ||
from_json('isSensitive'); | ||
} catch (err) { | ||
console.log(err); | ||
//リモートから取得に失敗 | ||
} | ||
return emoji; | ||
} |