为了解决ChatGPT小尾巴问题,通过SQL批量更新了大家的网页插件

@Ta 02-21 16:36发布,02-23 11:52修改 9100点击

修改后,在@ChatGPT的时候不会附带小尾巴。我修改了两种,其他的你们就自己改吧。


if (tail == content.substr(-tail.length)) tail = '';

替换为

if (tail == content.substr(-tail.length) || /@(ChatGPT|罐子2号|chat)\b/i.test(content)) tail = '';

if (tail.length > 0 & content.lastIndexOf(tail) < 0 & document.querySelector('#signture').checked) content += tail;

替换为

if (tail.length > 0 && content.lastIndexOf(tail) < 0 && document.querySelector('#signture').checked && ! /@(ChatGPT|罐子2号|chat)\b/i.test(content)) content += tail;

SQL:

update hu60_webplug set content = replace(
    content,
    "if (tail == content.substr(-tail.length)) tail = '';",
    "if (tail == content.substr(-tail.length) || /@(ChatGPT|罐子2号)/i.test(content)) tail = '';"
) where content like
    "%if (tail == content.substr(-tail.length)) tail = '';%";

update hu60_webplug set content = replace(
    content,
    "if (tail.length > 0 & content.lastIndexOf(tail) < 0 & document.querySelector('#signture').checked) content += tail;",
    "if (tail.length > 0 && content.lastIndexOf(tail) < 0 && document.querySelector('#signture').checked && ! /@(ChatGPT|罐子2号)/i.test(content)) content += tail;"
) where content like
    "%if (tail.length > 0 & content.lastIndexOf(tail) < 0 & document.querySelector('#signture').checked) content += tail;%";

select replace(content, '/@(ChatGPT|罐子2号)/i', '/@(ChatGPT|罐子2号|chat)\b/i') from hu60_webplug where content like '%/@(ChatGPT|罐子2号)/i%';
update hu60_webplug set content = replace(content, '/@(ChatGPT|罐子2号)/i', '/@(ChatGPT|罐子2号|chat)\b/i') where content like '%/@(ChatGPT|罐子2号)/i%';
回复列表(40)
添加新回复
回复需要登录