2017-07-15 03:04:16 +00:00
|
|
|
|
using Discord.WebSocket;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services.Impl
|
2017-07-15 03:04:16 +00:00
|
|
|
|
{
|
|
|
|
|
public class StartingGuildsService : IEnumerable<long>, INService
|
|
|
|
|
{
|
|
|
|
|
private readonly ImmutableList<long> _guilds;
|
|
|
|
|
|
|
|
|
|
public StartingGuildsService(DiscordSocketClient client)
|
|
|
|
|
{
|
|
|
|
|
this._guilds = client.Guilds.Select(x => (long)x.Id).ToImmutableList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerator<long> GetEnumerator() =>
|
|
|
|
|
_guilds.GetEnumerator();
|
|
|
|
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() =>
|
|
|
|
|
_guilds.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
}
|