feat: 欢迎语增加右下角弹窗通知;禁止对「大家」发送欢迎
This commit is contained in:
@@ -111,7 +111,11 @@
|
||||
*/
|
||||
function sendWelcomeTpl(tpl) {
|
||||
const toUser = document.getElementById('to_user')?.value || '大家';
|
||||
const name = toUser === '大家' ? '大家' : toUser;
|
||||
if (toUser === '大家') {
|
||||
window.chatDialog?.alert('欢迎语不能对「大家」发送,请先选择具体用户。', '🚫 提示', '#cc4444');
|
||||
return;
|
||||
}
|
||||
const name = toUser;
|
||||
const prefix = window.chatContext?.welcomePrefix || window.chatContext?.username || '';
|
||||
const body = tpl.replace(/\{name\}/g, name);
|
||||
const msg = `${prefix}:${body}`;
|
||||
|
||||
Reference in New Issue
Block a user