mirror of
https://github.com/spacebarchat/server.git
synced 2026-06-07 19:41:50 +00:00
User: handle autojoin synchronously
This commit is contained in:
@@ -349,19 +349,11 @@ export class User extends BaseClass {
|
||||
});
|
||||
}
|
||||
|
||||
setImmediate(async () => {
|
||||
if (bot) {
|
||||
const { guild } = Config.get();
|
||||
if (!guild.autoJoin.bots) {
|
||||
return;
|
||||
}
|
||||
const { guild } = Config.get();
|
||||
if (guild.autoJoin.enabled && !(bot && !guild.autoJoin.bots))
|
||||
for (const guild of Config.get().guild.autoJoin.guilds || []) {
|
||||
await Member.addToGuild(user.id, guild).catch((e) => console.error("[Autojoin]", e));
|
||||
}
|
||||
if (Config.get().guild.autoJoin.enabled) {
|
||||
for (const guild of Config.get().guild.autoJoin.guilds || []) {
|
||||
await Member.addToGuild(user.id, guild).catch((e) => console.error("[Autojoin]", e));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user