Drop the mutation and sequential-await rules and the stale directives. [skip build]
This commit is contained in:
@@ -396,10 +396,8 @@ export const rateLimitedActions = async <T, R = void>(
|
||||
for (let i = 0; i < data.length; i += 1) {
|
||||
const dataItem = data[i];
|
||||
retryCount = 0;
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await performAction(dataItem, i);
|
||||
if (actionInterval > 0) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await sleepForMs(actionInterval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,11 +217,9 @@ export async function importTelegramStickerPack(
|
||||
|
||||
try {
|
||||
// Get file path from Telegram
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const filePath = await getFilePath(botToken, sticker.file_id);
|
||||
|
||||
// Download the sticker
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
let blob = await downloadFile(botToken, filePath);
|
||||
|
||||
// Generate a shortcode from emoji or index
|
||||
@@ -235,20 +233,17 @@ export async function importTelegramStickerPack(
|
||||
// Convert animated stickers to GIF
|
||||
if (isAnimated && filePath.endsWith('.tgs')) {
|
||||
onProgress?.(i + 1, total, `Converting animated sticker ${i + 1}/${total} to GIF...`);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
blob = await tgsToGif(blob, sticker.width, sticker.height);
|
||||
finalMimeType = 'image/gif';
|
||||
extension = 'gif';
|
||||
} else if (isVideo && filePath.endsWith('.webm')) {
|
||||
onProgress?.(i + 1, total, `Converting video sticker ${i + 1}/${total} to GIF...`);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
blob = await webmToGif(blob, sticker.width, sticker.height);
|
||||
finalMimeType = 'image/gif';
|
||||
extension = 'gif';
|
||||
}
|
||||
|
||||
// Upload to Matrix
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const mxcUrl = await uploadToMatrix(mx, blob, `${shortcode}.${extension}`);
|
||||
|
||||
// Add to images
|
||||
|
||||
Reference in New Issue
Block a user