diff --git a/src/Nullinside.Api.Common/Twitch/ITwitchApiProxy.cs b/src/Nullinside.Api.Common/Twitch/ITwitchApiProxy.cs
index ab1fddb..1d49d3a 100644
--- a/src/Nullinside.Api.Common/Twitch/ITwitchApiProxy.cs
+++ b/src/Nullinside.Api.Common/Twitch/ITwitchApiProxy.cs
@@ -48,9 +48,17 @@ public interface ITwitchApiProxy {
/// Gets the twitch id and username of the owner of the .
///
/// The cancellation token.
- /// The twitch username if successful, null otherwise.
+ /// The twitch user information if successful, null otherwise.
Task<(string? id, string? username)> GetUser(CancellationToken token = new());
+ ///
+ /// Gets the twitch id and username of the username provided.
+ ///
+ /// The username to look up.
+ /// The cancellation token.
+ /// The twitch information if successful, null otherwise.
+ Task<(string? id, string? username)> GetUser(string username, CancellationToken token = new());
+
///
/// Gets the email address of the owner of the .
///
diff --git a/src/Nullinside.Api.Common/Twitch/TwitchApiProxy.cs b/src/Nullinside.Api.Common/Twitch/TwitchApiProxy.cs
index 25adbdc..f441760 100644
--- a/src/Nullinside.Api.Common/Twitch/TwitchApiProxy.cs
+++ b/src/Nullinside.Api.Common/Twitch/TwitchApiProxy.cs
@@ -150,6 +150,20 @@ public TwitchApiProxy(string token, string refreshToken, DateTime tokenExpires,
}, Retries, token);
}
+ ///
+ public virtual async Task<(string? id, string? username)> GetUser(string username, CancellationToken token = new()) {
+ return await Retry.Execute(async () => {
+ ITwitchAPI api = GetApi();
+ GetUsersResponse? response = await api.Helix.Users.GetUsersAsync(logins: [username]);
+ if (null == response) {
+ return (null, null);
+ }
+
+ User? user = response.Users.FirstOrDefault();
+ return (user?.Id, user?.Login);
+ }, Retries, token);
+ }
+
///
public virtual async Task GetUserEmail(CancellationToken token = new()) {
return await Retry.Execute(async () => {