feat: telegram use the random domain when not set (#704)

This commit is contained in:
Dream Hunter
2025-08-08 13:07:00 +08:00
committed by GitHub
parent bfd66f5019
commit 9843b35f54
10 changed files with 1265 additions and 1276 deletions

View File

@@ -108,9 +108,9 @@ export const newAddress = async (
}
// check domain
const allowDomains = checkAllowDomains ? await getAllowDomains(c) : getDomains(c);
// if domain is not set, use the first domain
// if domain is not set, use the random domain
if (!domain && allowDomains.length > 0) {
domain = allowDomains[0];
domain = allowDomains[Math.floor(Math.random() * allowDomains.length)];
}
// check domain is valid
if (!domain || !allowDomains.includes(domain)) {