2023-04-15 22:06:35 +02:00
|
|
|
import { User as DiscordUser } from "discord.js";
|
2023-04-16 02:02:40 +02:00
|
|
|
import { JellyfinHandler } from "../../jellyfin/handler";
|
|
|
|
import { logger } from "../logger";
|
|
|
|
|
2023-04-18 23:45:09 +02:00
|
|
|
/*
|
2023-04-16 02:02:40 +02:00
|
|
|
export async function addUser(discordUser: DiscordUser, jf: JellyfinHandler, guildId: string, requestId: string): Promise<any> {
|
|
|
|
if (!jf.isUserAlreadyPresent(discordUser, guildId, requestId)) {
|
|
|
|
logger.info(`User ${discordUser.username} is already registered on ${jf.ServerName}`)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
const jfUserAccount = await jf.createUserAccountForDiscordUser(discordUser, guildId, requestId)
|
|
|
|
if (jfUserAccount) {
|
|
|
|
await jf.addPermissionsToUserAccount(jfUserAccount,guildId,requestId)
|
|
|
|
}
|
2023-04-15 22:06:35 +02:00
|
|
|
return
|
|
|
|
}
|
2023-04-18 23:45:09 +02:00
|
|
|
*/
|