|
@@ -56,7 +56,15 @@ const handler: ModuleRpcServer.ServiceHandlerFor<typeof NoctBotService> = {
|
|
|
return { verified: await checkUser("check verified", userId, async (user, guild) => user.roles.cache.has(guild.verifiedRoleId)) };
|
|
|
},
|
|
|
async verifyUser({ userId }): Promise<{ ok: boolean }> {
|
|
|
- return { ok: !(await checkUser("verify", userId, async (user, guild) => !(await tryDo(user.roles.add(guild.verifiedRoleId))).ok)) };
|
|
|
+ return { ok: !(await checkUser("verify", userId, async (user, guild) => {
|
|
|
+ const result = await tryDo(user.roles.add(guild.verifiedRoleId));
|
|
|
+ if (result.ok) {
|
|
|
+ logger.info("Verifying user %s#%s (%s) on guild %s", user.user.username, user.user.discriminator, user.user.id, guild.guildId);
|
|
|
+ } else {
|
|
|
+ logger.warn("Failed to verify user %s#%s (%s) on guild %s: %s", user.user.username, user.user.discriminator, user.user.id, guild.guildId, result.error);
|
|
|
+ }
|
|
|
+ return !result.ok;
|
|
|
+ }))};
|
|
|
}
|
|
|
};
|
|
|
|