diff --git a/server/src/discord/commands/prod/rtmp.js b/server/src/discord/commands/prod/rtmp.js index e2605ee6..da70814c 100644 --- a/server/src/discord/commands/prod/rtmp.js +++ b/server/src/discord/commands/prod/rtmp.js @@ -10,6 +10,8 @@ module.exports = { .setName("rtmp") .addStringOption(option => option.setName("feed").setDescription("Name of the feed")) + .addUserOption(option => + option.setName("user").setDescription("User to get the feed of")) .addStringOption(option => option.setName("region") .setDescription("RTMP server region") @@ -28,8 +30,10 @@ module.exports = { await interaction.deferReply(); let feedId = interaction.options.getString("feed")?.toLocaleLowerCase(); + let targetUser = interaction.options.getUser("user") ?? interaction.user; + if (!feedId) { - let targetPlayer = await Cache.auth.getPlayer(interaction.user.id); + let targetPlayer = await Cache.auth.getPlayer(targetUser.id); let playerClient = await Cache.get(targetPlayer?.clients?.[0]); if (!playerClient || !playerClient?.key) { return interaction.followUp("Couldn't find a feed"); diff --git a/server/src/discord/commands/prod/srt.js b/server/src/discord/commands/prod/srt.js index 6f2f522c..431e8723 100644 --- a/server/src/discord/commands/prod/srt.js +++ b/server/src/discord/commands/prod/srt.js @@ -10,6 +10,8 @@ module.exports = { .setName("srt") .addStringOption(option => option.setName("feed").setDescription("Name of the feed")) + .addUserOption(option => + option.setName("user").setDescription("User to get the feed of")) .addStringOption(option => option.setName("region") .setDescription("SRT server region") @@ -37,8 +39,10 @@ module.exports = { await interaction.deferReply(); let feedId = interaction.options.getString("feed")?.toLocaleLowerCase(); + let targetUser = interaction.options.getUser("user") ?? interaction.user; + if (!feedId) { - let targetPlayer = await Cache.auth.getPlayer(interaction.user.id); + let targetPlayer = await Cache.auth.getPlayer(targetUser.id); let playerClient = await Cache.get(targetPlayer?.clients?.[0]); if (!playerClient || !playerClient?.key) { return interaction.followUp("Couldn't find a feed");