24 lines
781 B
C#
24 lines
781 B
C#
using HermesSocketServer.Models;
|
|
using ILogger = Serilog.ILogger;
|
|
|
|
namespace HermesSocketServer.Requests
|
|
{
|
|
public class GetChatterIds : IRequest
|
|
{
|
|
public string Name => "get_chatter_ids";
|
|
public string[] RequiredKeys => [];
|
|
private ILogger _logger;
|
|
|
|
public GetChatterIds(ILogger logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
|
{
|
|
IEnumerable<long> ids = channel.Chatters.Get().Values.Select(c => c.ChatterId);
|
|
_logger.Information($"Fetched all chatters for channel [channel: {channel.Id}]");
|
|
return Task.FromResult(RequestResult.Successful(ids, notifyClientsOnAccount: false));
|
|
}
|
|
}
|
|
} |