small adjustments
This commit is contained in:
parent
9eb0976b35
commit
ce174d4d2b
1 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ async function bttv_get_url(code: string): Promise<Emote> {
|
|||
|
||||
return {
|
||||
code: code,
|
||||
url: `https://cdn.betterttv.net/emote/${matches[0].id}/1x.${matches[0].imageType}`,
|
||||
url: `//cdn.betterttv.net/emote/${matches[0].id}/1x.${matches[0].imageType}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ async function get_emotes(codes: Iterable<string>): Promise<EmoteMap> {
|
|||
|
||||
// queue emote jobs
|
||||
const queue = [...codes_set].map((code) => bttv_get_url(code));
|
||||
console.log("[lmlfc-bttv] queueing", queue.length, "jobs");
|
||||
console.log("[lmlfc-bttv] queued", queue.length, "jobs");
|
||||
|
||||
// run
|
||||
const result: EmoteMap = {};
|
||||
|
@ -52,7 +52,7 @@ async function get_emotes(codes: Iterable<string>): Promise<EmoteMap> {
|
|||
|
||||
async function process_text(text: string): Promise<string> {
|
||||
const matches = [...text.matchAll(emote_regex)];
|
||||
const emotes = await get_emotes(matches.map((elem) => elem[1]));
|
||||
const emotes = await get_emotes(matches.map(([_, code]) => code));
|
||||
|
||||
for (const emote of matches.reverse()) {
|
||||
const [match, code] = emote;
|
||||
|
|
Loading…
Reference in a new issue