23
עריכות
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 1: | שורה 1: | ||
const BOT_USERS = [3987, 4025, 11975, 8589]; | |||
const BOT_USERS = [ | |||
const api = new mw.Api(); | const api = new mw.Api(); | ||
| שורה 39: | שורה 38: | ||
if (query?.pages) { | if (query?.pages) { | ||
const page = Object.values(query.pages)[0]; | const page = Object.values(query.pages)[0]; | ||
if (page.ns | if (page.ns) { | ||
const namespacePrefixes = { | const namespacePrefixes = { | ||
4: | 4: "חב"דפדיה:", | ||
6: "קובץ:", | 6: "קובץ:", | ||
10: "תבנית:", | 10: "תבנית:", | ||
12: "עזרה:", | 12: "עזרה:", | ||
}; | }; | ||
return namespacePrefixes[page.ns] ?? ""; | return namespacePrefixes[page.ns] ?? ""; | ||
| שורה 58: | שורה 56: | ||
action: "edit", | action: "edit", | ||
format: "json", | format: "json", | ||
tags: "doubleredirect-bot", | |||
bot: true, | bot: true, | ||
title: title, | title: title, | ||
text: `#הפניה [[${target}]]`, | text: `#הפניה [[${target}]]`, | ||
}); | }); | ||
mw.notify(`\nstatus:${title} | mw.notify(`\nstatus:${title} succes`); | ||
} catch (error) { | } catch (error) { | ||
console.error(error); | console.error(error); | ||