Skip to content

Commit 6d2c29a

Browse files
committed
fix: change link generation to new ipfs gateway
1 parent e6f63c0 commit 6d2c29a

13 files changed

+22
-22
lines changed

lib/telegram/assets/lang.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"greeting1": "Welcome, this group is moderated with ",
8181
"greeting2": "Please make sure to follow the [community rules]",
8282
"greeting3": "Users who break the rules can be reported by replying to a message with the command /report.",
83-
"defaultRules": "https://ipfs.kleros.io/ipfs/QmbgRUB4dEgcvRfYmWo34GJhpBGNWWJNsbz8dxN2QLTyLb/Kleros%20Moderate%20Community%20Rules%20v1.0.pdf",
83+
"defaultRules": "https://cdn.kleros.link/ipfs/QmbgRUB4dEgcvRfYmWo34GJhpBGNWWJNsbz8dxN2QLTyLb/Kleros%20Moderate%20Community%20Rules%20v1.0.pdf",
8484
"defaultRulesMsg1": "The Kleros Moderate Community Guidelines apply as the default [rules]",
8585
"defaultRulesMsg1alt": "The Kleros Moderate Community Guidelines apply as the default rules",
8686
"defaultRulesMsg2": "Crafting precise policies can be challenging, if you are certain in setting a new policy, you can set new rules with /setrules \\[url] or /setrules \\[reply to message]"
@@ -163,7 +163,7 @@
163163
"greeting1": "Welcome, this group is moderated with ",
164164
"greeting2": "Please make sure to follow the [community rules]",
165165
"greeting3": "Users who break the rules can be reported by replying to a message with the command /report.",
166-
"defaultRules": "https://ipfs.kleros.io/ipfs/QmYYcNfEYLtxPM8fof4wf9Tqj7gBGMDMmNnBqZKR1zSczX/Kleros%20Moderate%20Community%20Guidelines%20v1.pdf",
166+
"defaultRules": "https://cdn.kleros.link/ipfs/QmYYcNfEYLtxPM8fof4wf9Tqj7gBGMDMmNnBqZKR1zSczX/Kleros%20Moderate%20Community%20Guidelines%20v1.pdf",
167167
"defaultRulesMsg1": "The Kleros Moderate Community Guidelines apply as the default [rules].",
168168
"defaultRulesMsg2": "Crafting precise policies can be challenging, if you are certain in setting a new policy, you can set new rules with /setrules [url] or /setrules [reply to message]."
169169
}

lib/telegram/assets/langNew.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"welcome": {
182182
"welcome": "Hi, I'm Susie, a [Kleros Moderate](https://kleros.io/moderate/) bot.\n\nI need permission from an admin to /start.\n\nHow do I help with moderation?\n\n1. I ask \"Did a user break the rules?\" on the crowdsourcing platform [Reality.Eth](https://realityeth.github.io/).\n2. The question is answered with an escalation game using xDai on [Gnosis Chain](https://www.gnosis.io/).\n3. The answer can be disputed in the [Kleros](https://kleros.io/) court.\n\nTo learn more, [DM](https://t.me/SusieTheKlerosModeratorBot?start=help) me, read my [docs](https://kleros.gitbook.io/docs/products/moderate/susie), or ask a question in @SusieSupport."
183183
},
184-
"defaultRules": "https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf",
184+
"defaultRules": "https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf",
185185
"index": {
186186
"supergroup": "Hi! I'm Susie, a moderation and group management bot. I can only manage supergroups. To promote this group to a supergroup, make the group public or promote any member to a full admin and try to /start me again.",
187187
"channel": "The channel id is ",
@@ -198,7 +198,7 @@
198198
"Topics1": "ℹ️ *Topics* ℹ️\n\nTopics allow large groups to focus discussion in dedicated **topic** chats. Susie supports topics. When changing a group to topic mode, you will need to /start Susie again.\n\n*Admin commands*:\n- `/start`: Start topic mode.",
199199
"Evidence1": "🔍 *Evidence* 🔍\n\nTo prevent important messages from deletion, pre-emptively, messages can be saved as evidence.\n\n*User commands*:\n- `/evidence` <by reply>: Saves message as evidence.",
200200
"Report1": "🚨 *Report* 🚨\n\nReports create content moderation questions on the crowdsourcing platform Reality.Eth asking,\n\n***Did the user break the rules?***\n\nThe question can be answered yes/no with a bond (1 xDAI). Answers can be disputed in the Kleros court.\n\nSuccessful reports result in escalating penalties (1 day, 10 days, 100 days, and finally permanent ban).\n\n*User commands*:\n- `/report` <by reply>: Reports message.\n- `/info`: Returns active reports\n\n*Admin commands*:\n-`/adminreportable` Toggles reportability of admins.\n- `/trial` Toggles trial mode where users are not penalized",
201-
"Rules1": "📄 *Rules* 📄\n\nEvery groups starts with [default rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf).\n\n***Rule Writing Tips***:\n\n- State the group culture in a preamble.\n- Number each rule.\n- Be specific.\n\n*User commands*:\n- `/rules`: Returns current rules\n*Admin commands*:\n- `/setrules` <by reply> or <url>: Sets the rules to the url or message",
201+
"Rules1": "📄 *Rules* 📄\n\nEvery groups starts with [default rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf).\n\n***Rule Writing Tips***:\n\n- State the group culture in a preamble.\n- Number each rule.\n- Be specific.\n\n*User commands*:\n- `/rules`: Returns current rules\n*Admin commands*:\n- `/setrules` <by reply> or <url>: Sets the rules to the url or message",
202202
"Court1": "⚖️ *Court* ⚖️\n\nModeration questions are resolved by the [Kleros Court](https://kleros.gitbook.io/docs/) with a jury of moderators. If the jury made a mistake, the case can be appealed, drawing a larger pool of jurors and providing an opportunity to provide more context, analysis, and arguments.\n\nIf you would like a chance to serve as a jury member, get PNK ([Gnosis Chain](https://swapr.eth.link/#/swap?chainId=100) or [Mainnet](https://app.uniswap.org/#/swap?outputCurrency=0x93ed3fbe21207ec2e8f2d3c3de6e058cb73bc04d&inputCurrency=ETH)) and [stake](https://court.kleros.io/) in the Kleros court.\n\nTo discuss the merits of a dispute, see @klerosjuror. To learn more about Kleros, ask a question in @Kleros",
203203
"Lawyer1": "🧑‍⚖️ *Find a Lawyer* 🧑‍⚖️\n\nDisputes over content moderation questions can be complicated.\n\nIf you need help arguing your case in the Kleros court, consider asking help from a Kleros [lawyer](https://t.me/+9fvGGkGfSZ1hZDBk).",
204204
"Privacy1": "🕵️ *Privacy* 🕵️\n\nTo provide context, users can request Susie to save messages to submit as evidence on their behalf. Susie manages moderation private and public groups differently,\n\n- ***Private Groups***: Moderators depend on evidence submissions alone.\n\n- ***Public Groups***: Moderators have access to the full public chat history.",
@@ -382,7 +382,7 @@
382382
"welcome": {
383383
"welcome": "Hola, soy Susie, un bot [Kleros Moderate](https://kleros.io/moderate/). Necesito permiso de un administrador para /start. ¿Cómo puedo ayudar con la moderación?\n\n 1. Pregunto\n\n'¿Un usuario ha infringido las normas?'n\n\nen la plataforma de crowdsourcing [Reality.Eth](https://realityeth.github.io/).\n2. La pregunta se responde con un juego de escalada usando xDai en [Gnosis Chain](https://www.gnosis.io/).\n3. La respuesta se puede disputar en el tribunal [Kleros](https://kleros.io/).\n\nPara saber más, [DM](https://t.me/SusieTheKlerosModeratorBot?start=help), lee mis [docs](https://kleros.gitbook.io/docs/products/moderate/susie), o haz una pregunta en @SusieSupport."
384384
},
385-
"defaultRules": "https://ipfs.kleros.io/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf",
385+
"defaultRules": "https://cdn.kleros.link/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf",
386386
"help": {
387387
"DM": "Obtener ayuda (DM)",
388388
"DM2": "DM de ayuda : )",
@@ -393,7 +393,7 @@
393393
"Topics1": "ℹ️ *Temas* ℹ️\n\nLos temas permiten a los grandes grupos centrar el debate en chats dedicados a **temas**. Susie es compatible con los temas. Cuando cambie un grupo a modo de tema, necesitará /iniciar Susie de nuevo.\n\n*Comandos de administrador*:\n- `/start`: Inicia el modo por temas.",
394394
"Evidence1": "🔍 *Evidencia* 🔍\n\nPara evitar que se borren mensajes importantes, de forma preventiva, se pueden guardar mensajes como evidencia.\n\n*Comandos de usuario*:\n- `/evidence` <por respuesta>: Guarda el mensaje como evidencia.",
395395
"Report1": "🚨 *Denuncia* 🚨 \n\nLas denuncias crean preguntas de moderación de contenidos en la plataforma de crowdsourcing Reality.Eth preguntando,\n\n'¿el usuario infringió las normas?'\n\nLa pregunta puede responderse sí/no con un bono (1 xDAI). Las respuestas pueden ser impugnadas en el tribunal Kleros.\n\nLas denuncias exitosos resultan en sanciones escalonadas (1 día, 10 días, 100 días, y finalmente prohibición permanente).\n\n*Comandos de usuario*:\n- `/report` <por respuesta>: Informa del mensaje.\n- `/info`: Devuelve las denuncias activos.n\n*Comandos de administrador*:\n-`/adminreportable` Activa la posibilidad de informar de los administradores.\n- `/trial` Activa el modo de prueba en el que los usuarios no son penalizados.",
396-
"Rules1": "📄 *Reglas* 📄\n\nTodos los grupos empiezan con [reglas por defecto](https://ipfs.kleros.io/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf). \n\n***Consejos para la redacción de reglas***:\n\n -Enuncie la cultura del grupo en un preámbulo.\n -Numere cada regla.\nSea específico.\n\n*Comandos de usuario*:\n-`/rules`: Devuelve las reglas.\n*Comandos de administrador*:\n- `/setrules` <by reply> o <url>: Establece las reglas a la url o mensaje.",
396+
"Rules1": "📄 *Reglas* 📄\n\nTodos los grupos empiezan con [reglas por defecto](https://cdn.kleros.link/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf). \n\n***Consejos para la redacción de reglas***:\n\n -Enuncie la cultura del grupo en un preámbulo.\n -Numere cada regla.\nSea específico.\n\n*Comandos de usuario*:\n-`/rules`: Devuelve las reglas.\n*Comandos de administrador*:\n- `/setrules` <by reply> o <url>: Establece las reglas a la url o mensaje.",
397397
"Court1": "⚖️ *Corte* ⚖️\n\nLas preguntas de moderación las resuelve el [Kleros Court](https://kleros.gitbook.io/docs/) con un jurado de moderadores. Si el jurado cometió un error, el caso puede ser apelado, atrayendo a un grupo más grande de miembros del jurado y proporcionando la oportunidad de proporcionar más contexto, análisis y argumentos.\n\nSi desea tener la oportunidad de servir como miembro del jurado, obtenga PNK ([Gnosis Chain](https://swapr.eth.link/#/swap?chainId=100) o [Mainnet](https://app.uniswap.org/#/swap?outputCurrency=0x93ed3fbe21207ec2e8f2d3c3de6e058cb73bc04d&inputCurrency=ETH)) y [stake](https://court.kleros.io/) en el tribunal de Kleros.\n\nPara discutir el fondo de una disputa, consulte @klerosjuror.",
398398
"Lawyer1": "🧑‍⚖️ *Busque un abogado* 🧑‍⚖️ \n\nLas disputas sobre denuncias pueden ser complicadas.\n\nSi necesita ayuda para defender su caso ante el tribunal kleros, considere pedir ayuda a un [abogado] kleros(https://t.me/+9fvGGkGfSZ1hZDBk).",
399399
"Privacy1": "🕵️ *Privacidad* 🕵️\n\nPara proporcionar contexto, los usuarios pueden solicitar a Susie que guarde mensajes para presentarlos como evidencia en su nombre. Susie gestiona la moderación de grupos privados y públicos de forma diferente,\n\n- *** Grupos Privados ***: Los moderadores dependen únicamente de las evidencia presentadas\n\n- *** Grupos Públicos ***: Los moderadores tienen acceso a todo el historial del chat público.",

lib/telegram/commands/addEvidence.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const processCommand = async (queue: any, bot: any, settings: groupSettings, msg
3636
const evidenceJsonPath = await uploadEvidenceJson(settings.lang, msg, evidencePath,isPrivate);
3737
try{
3838
queue.add(async () => {try{
39-
const resp = await bot.sendMessage(msg.chat.id, `${langJson[settings.lang].addevidence.submitted}(https://ipfs.kleros.io${evidencePath}).`, msg.is_topic_message? {parse_mode: "Markdown", message_thread_id: msg.message_thread_id, disable_web_page_preview: true}:{parse_mode: "Markdown", disable_web_page_preview: true})
39+
const resp = await bot.sendMessage(msg.chat.id, `${langJson[settings.lang].addevidence.submitted}(https://cdn.kleros.link${evidencePath}).`, msg.is_topic_message? {parse_mode: "Markdown", message_thread_id: msg.message_thread_id, disable_web_page_preview: true}:{parse_mode: "Markdown", disable_web_page_preview: true})
4040
return resp.message_id}catch{}});
4141
} catch(e){
4242
console.log(e)

lib/telegram/commands/help.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const helpnotifications = (queue: any, db: any, settings: groupSettings, bot: an
2020
const lang_code = msg?.from?.language_code
2121
try{
2222
queue.add(async () => {try{await bot.sendMessage(msg.chat.id, langJson[lang_code].help.Notifications1,{parse_mode: 'Markdown', disable_web_page_preview: true})}catch{}})
23-
//queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://ipfs.kleros.io/ipfs/QmaWKFxR8TNzWW1xDuzXe4XFE5wCFJVuFP6AKCQ3LRAQqB/Screen%20Recording%202022-12-13%20at%209.19.17%20PM(1).mp4`));
23+
//queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://cdn.kleros.link/ipfs/QmaWKFxR8TNzWW1xDuzXe4XFE5wCFJVuFP6AKCQ3LRAQqB/Screen%20Recording%202022-12-13%20at%209.19.17%20PM(1).mp4`));
2424
} catch(e){
2525
console.log(e)
2626
}
@@ -228,7 +228,7 @@ const respond = (queue: any, settings: groupSettings, bot: any, helpType: string
228228
break;
229229
}
230230
case 'court': {
231-
//https://ipfs.kleros.io/ipfs/QmZwVBdfALRWbjCLtLNSq9YceADCtP96hfPkg3Y6f6xWJk/KlerosModerate.png
231+
//https://cdn.kleros.link/ipfs/QmZwVBdfALRWbjCLtLNSq9YceADCtP96hfPkg3Y6f6xWJk/KlerosModerate.png
232232
queue.add(async () => {try{await bot.editMessageText(langJson[lang_code].help.Court1,optsResponse)}catch{}})
233233
break;
234234
}

lib/telegram/commands/report.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const callback = async (queue: any, db:any, settings: groupSettings, bot: Telegr
135135
return
136136
const isPrivate = !chatobj.active_usernames;
137137
const evidencepath = await upload(queue, bot, settings.lang, msg, isPrivate);
138-
const msgBackup = 'https://ipfs.kleros.io'+evidencepath;
138+
const msgBackup = 'https://cdn.kleros.link'+evidencepath;
139139
// TODO report
140140
const reportAllowance = getAllowance(db, 'telegram', String(msg.chat.id), String(msg.from.id));
141141
console.log(reportAllowance)

lib/telegram/commands/setChannel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: Teleg
7777
if(!channelUserSusie)
7878
return
7979
if (channelUserSusie.status !== "administrator"){
80-
const resp = await queue.add(async () => {try{const val = await bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', {caption: langJson[settings.lang].errorAdminRights})
80+
const resp = await queue.add(async () => {try{const val = await bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', {caption: langJson[settings.lang].errorAdminRights})
8181
return val}catch{}});
8282
if(!resp)
8383
return

lib/telegram/commands/setChannelFed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any,
8484
if(!channelUserSusie)
8585
return
8686
if (channelUserSusie.status !== "administrator"){
87-
const resp = await queue.add(async () => {try{const val = await bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', {caption: langJson[settings.lang].errorAdminRights},msg.chat.is_forum? {message_thread_id: msg.message_thread_id, parse_mode: 'Markdown'} : {parse_mode: 'Markdown'})
87+
const resp = await queue.add(async () => {try{const val = await bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', {caption: langJson[settings.lang].errorAdminRights},msg.chat.is_forum? {message_thread_id: msg.message_thread_id, parse_mode: 'Markdown'} : {parse_mode: 'Markdown'})
8888
return val}catch{}});
8989
if(!resp)
9090
return

lib/telegram/commands/setRules.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any,
2626
const msg_id = msg.chat.is_forum? msg.is_topic_message? msg.message_thread_id: 1 : ''+msg.reply_to_message.message_id;
2727
const MsgLink = 'https://t.me/c/' + String(msg.chat.id).substring(4) + '/' + msg_id;
2828

29-
setRulesCustom(db, 'telegram', String(msg.chat.id), 'https://ipfs.kleros.io'+rulesPath, Math.floor(Date.now()/1000), msg_id);
30-
queue.add(async () => {try{await bot.sendMessage(msg.chat.id, `${langJson[settings.lang].rulesUpdated}(https://ipfs.kleros.io${rulesPath}).`, msg.chat.is_forum? {message_thread_id: settings.thread_id_rules, parse_mode: 'Markdown'}: {parse_mode: "Markdown"})}catch{}});
29+
setRulesCustom(db, 'telegram', String(msg.chat.id), 'https://cdn.kleros.link'+rulesPath, Math.floor(Date.now()/1000), msg_id);
30+
queue.add(async () => {try{await bot.sendMessage(msg.chat.id, `${langJson[settings.lang].rulesUpdated}(https://cdn.kleros.link${rulesPath}).`, msg.chat.is_forum? {message_thread_id: settings.thread_id_rules, parse_mode: 'Markdown'}: {parse_mode: "Markdown"})}catch{}});
3131
if(msg.chat.is_forum){
3232
const msgRules = await queue.add(async () => {try{const val = await bot.forwardMessage(msg.chat.id, msg.chat.id, msg.reply_to_message.message_id, {message_thread_id: settings.thread_id_rules})
3333
return val}catch{}});

0 commit comments

Comments
 (0)