diff --git a/lib/telegram/assets/lang.json b/lib/telegram/assets/lang.json index eb55e88..839ee8d 100644 --- a/lib/telegram/assets/lang.json +++ b/lib/telegram/assets/lang.json @@ -80,7 +80,7 @@ "greeting1": "Welcome, this group is moderated with ", "greeting2": "Please make sure to follow the [community rules]", "greeting3": "Users who break the rules can be reported by replying to a message with the command /report.", - "defaultRules": "https://ipfs.kleros.io/ipfs/QmbgRUB4dEgcvRfYmWo34GJhpBGNWWJNsbz8dxN2QLTyLb/Kleros%20Moderate%20Community%20Rules%20v1.0.pdf", + "defaultRules": "https://cdn.kleros.link/ipfs/QmbgRUB4dEgcvRfYmWo34GJhpBGNWWJNsbz8dxN2QLTyLb/Kleros%20Moderate%20Community%20Rules%20v1.0.pdf", "defaultRulesMsg1": "The Kleros Moderate Community Guidelines apply as the default [rules]", "defaultRulesMsg1alt": "The Kleros Moderate Community Guidelines apply as the default rules", "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 @@ "greeting1": "Welcome, this group is moderated with ", "greeting2": "Please make sure to follow the [community rules]", "greeting3": "Users who break the rules can be reported by replying to a message with the command /report.", - "defaultRules": "https://ipfs.kleros.io/ipfs/QmYYcNfEYLtxPM8fof4wf9Tqj7gBGMDMmNnBqZKR1zSczX/Kleros%20Moderate%20Community%20Guidelines%20v1.pdf", + "defaultRules": "https://cdn.kleros.link/ipfs/QmYYcNfEYLtxPM8fof4wf9Tqj7gBGMDMmNnBqZKR1zSczX/Kleros%20Moderate%20Community%20Guidelines%20v1.pdf", "defaultRulesMsg1": "The Kleros Moderate Community Guidelines apply as the default [rules].", "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]." } diff --git a/lib/telegram/assets/langNew.json b/lib/telegram/assets/langNew.json index 9b20497..0deb4ae 100644 --- a/lib/telegram/assets/langNew.json +++ b/lib/telegram/assets/langNew.json @@ -181,7 +181,7 @@ "welcome": { "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." }, - "defaultRules": "https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf", + "defaultRules": "https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf", "index": { "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.", "channel": "The channel id is ", @@ -198,7 +198,7 @@ "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.", "Evidence1": "🔍 *Evidence* 🔍\n\nTo prevent important messages from deletion, pre-emptively, messages can be saved as evidence.\n\n*User commands*:\n- `/evidence` : Saves message as evidence.", "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` : 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", - "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` or : Sets the rules to the url or message", + "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` or : Sets the rules to the url or message", "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", "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).", "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 @@ "welcome": { "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." }, - "defaultRules": "https://ipfs.kleros.io/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf", + "defaultRules": "https://cdn.kleros.link/ipfs/QmSHAjfD1MYPtyopFoXcUQ5Ny3sfs5re1yz3h3TZ5qGDsp/Kleros%20Moderate%20Normas%20comunitarias.pdf", "help": { "DM": "Obtener ayuda (DM)", "DM2": "DM de ayuda : )", @@ -393,7 +393,7 @@ "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.", "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` : Guarda el mensaje como evidencia.", "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` : 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.", - "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` o : Establece las reglas a la url o mensaje.", + "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` o : Establece las reglas a la url o mensaje.", "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.", "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).", "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.", diff --git a/lib/telegram/commands/addEvidence.ts b/lib/telegram/commands/addEvidence.ts index 29099bf..c6855ef 100644 --- a/lib/telegram/commands/addEvidence.ts +++ b/lib/telegram/commands/addEvidence.ts @@ -36,7 +36,7 @@ const processCommand = async (queue: any, bot: any, settings: groupSettings, msg const evidenceJsonPath = await uploadEvidenceJson(settings.lang, msg, evidencePath,isPrivate); try{ queue.add(async () => {try{ - 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}) + 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}) return resp.message_id}catch{}}); } catch(e){ console.log(e) diff --git a/lib/telegram/commands/help.ts b/lib/telegram/commands/help.ts index b7967a4..5c2c55a 100644 --- a/lib/telegram/commands/help.ts +++ b/lib/telegram/commands/help.ts @@ -20,7 +20,7 @@ const helpnotifications = (queue: any, db: any, settings: groupSettings, bot: an const lang_code = msg?.from?.language_code try{ queue.add(async () => {try{await bot.sendMessage(msg.chat.id, langJson[lang_code].help.Notifications1,{parse_mode: 'Markdown', disable_web_page_preview: true})}catch{}}) - //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`)); + //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`)); } catch(e){ console.log(e) } @@ -228,7 +228,7 @@ const respond = (queue: any, settings: groupSettings, bot: any, helpType: string break; } case 'court': { - //https://ipfs.kleros.io/ipfs/QmZwVBdfALRWbjCLtLNSq9YceADCtP96hfPkg3Y6f6xWJk/KlerosModerate.png + //https://cdn.kleros.link/ipfs/QmZwVBdfALRWbjCLtLNSq9YceADCtP96hfPkg3Y6f6xWJk/KlerosModerate.png queue.add(async () => {try{await bot.editMessageText(langJson[lang_code].help.Court1,optsResponse)}catch{}}) break; } diff --git a/lib/telegram/commands/report.ts b/lib/telegram/commands/report.ts index 33efa55..f4164cd 100644 --- a/lib/telegram/commands/report.ts +++ b/lib/telegram/commands/report.ts @@ -135,7 +135,7 @@ const callback = async (queue: any, db:any, settings: groupSettings, bot: Telegr return const isPrivate = !chatobj.active_usernames; const evidencepath = await upload(queue, bot, settings.lang, msg, isPrivate); - const msgBackup = 'https://ipfs.kleros.io'+evidencepath; + const msgBackup = 'https://cdn.kleros.link'+evidencepath; // TODO report const reportAllowance = getAllowance(db, 'telegram', String(msg.chat.id), String(msg.from.id)); console.log(reportAllowance) diff --git a/lib/telegram/commands/setChannel.ts b/lib/telegram/commands/setChannel.ts index cdd8f94..8beb00e 100644 --- a/lib/telegram/commands/setChannel.ts +++ b/lib/telegram/commands/setChannel.ts @@ -77,7 +77,7 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: Teleg if(!channelUserSusie) return if (channelUserSusie.status !== "administrator"){ - 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}) + 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}) return val}catch{}}); if(!resp) return diff --git a/lib/telegram/commands/setChannelFed.ts b/lib/telegram/commands/setChannelFed.ts index ac4dada..c84d569 100644 --- a/lib/telegram/commands/setChannelFed.ts +++ b/lib/telegram/commands/setChannelFed.ts @@ -84,7 +84,7 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any, if(!channelUserSusie) return if (channelUserSusie.status !== "administrator"){ - 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'}) + 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'}) return val}catch{}}); if(!resp) return diff --git a/lib/telegram/commands/setRules.ts b/lib/telegram/commands/setRules.ts index 0675a50..110a607 100644 --- a/lib/telegram/commands/setRules.ts +++ b/lib/telegram/commands/setRules.ts @@ -26,8 +26,8 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any, const msg_id = msg.chat.is_forum? msg.is_topic_message? msg.message_thread_id: 1 : ''+msg.reply_to_message.message_id; const MsgLink = 'https://t.me/c/' + String(msg.chat.id).substring(4) + '/' + msg_id; - setRulesCustom(db, 'telegram', String(msg.chat.id), 'https://ipfs.kleros.io'+rulesPath, Math.floor(Date.now()/1000), msg_id); - 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{}}); + setRulesCustom(db, 'telegram', String(msg.chat.id), 'https://cdn.kleros.link'+rulesPath, Math.floor(Date.now()/1000), msg_id); + 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{}}); if(msg.chat.is_forum){ 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}) return val}catch{}}); diff --git a/lib/telegram/commands/start.ts b/lib/telegram/commands/start.ts index 212f494..902a87f 100644 --- a/lib/telegram/commands/start.ts +++ b/lib/telegram/commands/start.ts @@ -87,13 +87,13 @@ const callback = async (queue:any, db: any, settings: groupSettings, bot: any, b return if(botUser.status !== "administrator" || !botUser.can_restrict_members){ const video = msg.chat.is_forum? 'QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4' : 'QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4' - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://ipfs.kleros.io/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: ""} : {caption: "Please give Susie full admin rights.\n\nThen try to /start community moderation again."})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://cdn.kleros.link/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: ""} : {caption: "Please give Susie full admin rights.\n\nThen try to /start community moderation again."})}catch{}}); return; queue.add(async () => {try{await bot.sendMessage(msg.chat.id, 'I am ', msg.chat.is_forum? {parse_mode: "Markdown", message_thread_id: msg.message_thread_id, disable_web_page_preview: true}: {parse_mode: "Markdown", disable_web_page_preview: true})}catch{}}) } if (msg.chat.is_forum){ if(!botUser.can_manage_topics){ - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[lang_code].index.topicError})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[lang_code].index.topicError})}catch{}}); return; } const thread_ids = getThreadIDNotifications(db, 'telegram', String(msg.chat.id)); @@ -114,7 +114,7 @@ const callback = async (queue:any, db: any, settings: groupSettings, bot: any, b } catch (e){ try{ if (msg.chat.is_forum){ - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[lang_code].error.topic})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[lang_code].error.topic})}catch{}}); } } catch (e){ console.log(e) diff --git a/lib/telegram/commands/toggleCaptcha.ts b/lib/telegram/commands/toggleCaptcha.ts index 49cffa5..32cf52c 100644 --- a/lib/telegram/commands/toggleCaptcha.ts +++ b/lib/telegram/commands/toggleCaptcha.ts @@ -18,13 +18,13 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any, if(botUser.status !== "administrator" || !botUser.can_restrict_members){ const video = msg.chat.is_forum? 'QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4' : 'QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4' const msgerror = langJson[settings.lang].error.adminbot - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://ipfs.kleros.io/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: msgerror} : {caption: msgerror})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://cdn.kleros.link/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: msgerror} : {caption: msgerror})}catch{}}); return; } if (msg.chat.is_forum){ if(!botUser.can_manage_topics){ - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[settings.lang].error.topics})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4', {message_thread_id: msg.message_thread_id, caption: langJson[settings.lang].error.topics})}catch{}}); return; } if (!settings.thread_id_welcome){ diff --git a/lib/telegram/commands/toggleEnforcement.ts b/lib/telegram/commands/toggleEnforcement.ts index 4b835f7..c1b7009 100644 --- a/lib/telegram/commands/toggleEnforcement.ts +++ b/lib/telegram/commands/toggleEnforcement.ts @@ -17,7 +17,7 @@ const callback = async (queue: any, db: any, settings: groupSettings, bot: any, if(botUser.status !== "administrator" || !botUser.can_restrict_members){ const video = msg.chat.is_forum? 'QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4' : 'QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4' const msg_error = langJson[settings.lang].error.adminbot - queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://ipfs.kleros.io/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: msg_error} : {caption: msg_error})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(msg.chat.id, `https://cdn.kleros.link/ipfs/${video}`, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: msg_error} : {caption: msg_error})}catch{}}); return; } setEnforcementMode(db, 'telegram', String(msg.chat.id),settings.enforcement? 0: 1) diff --git a/lib/telegram/commands/welcome.ts b/lib/telegram/commands/welcome.ts index c2726fc..d26537b 100644 --- a/lib/telegram/commands/welcome.ts +++ b/lib/telegram/commands/welcome.ts @@ -16,7 +16,7 @@ const callback = async (queue: any, settings: groupSettings, bot: any, msg: any) const lang_code = msg?.from?.language_code queue.add(async () => {try{await bot.sendMessage(msg.chat.id, langJson[lang_code].welcome.welcome, msg.chat.is_forum? {message_thread_id: msg.message_thread_id, parse_mode: "Markdown"}: {parse_mode: "Markdown"})}catch{}}); //const options = msg.chat.is_forum? {message_thread_id: msg.message_thread_id, caption: "To get started, give Susie admin rights."} : {caption: "To get started, give Susie admin rights."} - //bot.sendVideo(msg.chat.id, 'https://ipfs.kleros.io/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', options); + //bot.sendVideo(msg.chat.id, 'https://cdn.kleros.link/ipfs/QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4', options); } catch (error) { console.log(error); } diff --git a/lib/telegram/index.ts b/lib/telegram/index.ts index 0fec7a1..86b2e3d 100644 --- a/lib/telegram/index.ts +++ b/lib/telegram/index.ts @@ -119,7 +119,7 @@ bot.on("my_chat_member", async function(myChatMember: any) { else try{ const video = myChatMember.chat.is_forum? 'QmSdP3SDoHCdW739xLDBKM3gnLeeZug77RgwgxBJSchvYV/guide_topics.mp4' : 'QmbnEeVzBjcAnnDKGYJrRo1Lx2FFnG62hYfqx4fLTqYKC7/guide.mp4' - queue.add(async () => {try{await bot.sendVideo(myChatMember.chat.id, `https://ipfs.kleros.io/ipfs/${video}`, {caption: langJson[lang_code].index.supergroup})}catch{}}); + queue.add(async () => {try{await bot.sendVideo(myChatMember.chat.id, `https://cdn.kleros.link/ipfs/${video}`, {caption: langJson[lang_code].index.supergroup})}catch{}}); } catch(e){ console.log(e) }