feat: basic initial implementation of spotify client link validator and song submission form refs: NOISSUE
This commit is contained in:
@@ -7,8 +7,13 @@ public class SignalIntegration
|
||||
{
|
||||
public static SignalIntegration? Instance;
|
||||
|
||||
private readonly ILogger logger;
|
||||
|
||||
public SignalIntegration(string uri, int port, string phoneNumber)
|
||||
{
|
||||
using ILoggerFactory factory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Information));
|
||||
this.logger = factory.CreateLogger("SignalIntegration");
|
||||
|
||||
var http = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(uri + ":" + port)
|
||||
@@ -24,17 +29,19 @@ public class SignalIntegration
|
||||
|
||||
public async Task ListGroupsAsync()
|
||||
{
|
||||
logger.LogDebug("Listing all groups for phone number: {PhoneNumber}", this.phoneNumber);
|
||||
|
||||
try
|
||||
{
|
||||
ICollection<song_of_the_day.GroupEntry> groupEntries = await apiClient.GroupsAllAsync(this.phoneNumber);
|
||||
foreach (var group in groupEntries)
|
||||
{
|
||||
Console.WriteLine($"{group.Name} {group.Id}");
|
||||
logger.LogDebug($" {group.Name} {group.Id}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception (ListGroupsAsync): " + ex.Message);
|
||||
logger.LogError("Exception (ListGroupsAsync): " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +59,7 @@ public class SignalIntegration
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception (SendMessageToGroupAsync): " + ex.Message);
|
||||
logger.LogError("Exception (SendMessageToGroupAsync): " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +77,7 @@ public class SignalIntegration
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception (SendMessageToUserAsync): " + ex.Message);
|
||||
logger.LogError("Exception (SendMessageToUserAsync): " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +104,7 @@ public class SignalIntegration
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception (GetMemberListAsync): " + ex.Message);
|
||||
logger.LogError("Exception (GetMemberListAsync): " + ex.Message);
|
||||
}
|
||||
return new List<string>();
|
||||
}
|
||||
@@ -117,7 +124,7 @@ public class SignalIntegration
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception (GetContactAsync): " + ex.Message);
|
||||
logger.LogError("Exception (GetContactAsync): " + ex.Message);
|
||||
return new ListContactsResponse();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user