Нормальные кавычки

This commit is contained in:
pixtaded 2024-08-28 17:39:17 +03:00
parent 15cf28be75
commit 6916446b11
2 changed files with 12 additions and 5 deletions

7
config.json Normal file
View File

@ -0,0 +1,7 @@
{
"token": "MTI3NDQ2ODg0NDc1NjUzMzM3NA.GNrFeQ.8nIvjf_jUqtfMYjDlpzJQssxNVF87dpKCAK9hI",
"ALLOWED_IDS": ["1266775948548903026", "1151129960141037659", "1275008490959667234", "1234866477086019648", "1277611369578889277", "1242022836529266708", "1275098630059200586", "1277311957405405296", "1277936618749300760", "1275899048171409528"],
"admin": "593524756393754635",
"shapeGuild": "1277635303363973173",
"shapeChannel": "1277652579547086860"
}

View File

@ -22,24 +22,24 @@ async function getMessageContent(message) {
const attachment = message.attachments.first(); const attachment = message.attachments.first();
if (!attachment.url) { if (!attachment.url) {
console.error('URL вложения не найден.'); console.error("URL вложения не найден.");
return "Я нихуя не понял."; return "Я нихуя не понял.";
} }
const response = await axios.get(attachment.url, { responseType: 'arraybuffer' }); const response = await axios.get(attachment.url, { responseType: "arraybuffer" });
if (!response.data) { if (!response.data) {
console.error('Ошибка: response.data is undefined.'); console.error("Ошибка: response.data is undefined.");
return "Я нихуя не понял."; return "Я нихуя не понял.";
} }
const buffer = Buffer.from(response.data, 'binary'); const buffer = Buffer.from(response.data, "binary");
const file = new MessageAttachment(buffer, attachment.name); const file = new MessageAttachment(buffer, attachment.name);
if (message.content) return { content: `${message.author.displayName}: ${message.content} `, files: [file] }; if (message.content) return { content: `${message.author.displayName}: ${message.content} `, files: [file] };
else return {files: [file]}; else return {files: [file]};
} catch (error) { } catch (error) {
console.error('Ошибка при получении файла:', error.message); console.error("Ошибка при получении файла:", error.message);
return message.author.displayName + ": " + message.content + " "; return message.author.displayName + ": " + message.content + " ";
} }
} else { } else {