コード例 #1
0
ファイル: Program.cs プロジェクト: Djporks69/Town-Crier
    private async Task MainAsync()
    {
        await ApiAccess.EnsureLoggedIn();

        commandsProcessor = new CommandsProcessor(client);
        await commandsProcessor.Initialize();

        ChannelFilters.Apply(commandsProcessor);

        NewcomerHandler.Initialize(client);

        client.Ready += ClientReadyAsync;

        client.Disconnected += Disconnected;

        await EnableRoleManager();

        await client.LoginAsync(TokenType.Bot, token);

        await client.StartAsync();

        await client.SetGameAsync("A Chatty Township Tale");

        AccountModule.EnsureLoaded();

        await Task.Delay(-1);
    }
コード例 #2
0
ファイル: Program.cs プロジェクト: whattheshark/Town-Crier
    Task ClientReadyAsync()
    {
        Console.WriteLine("Client Ready");

        ChannelFilters.Apply(commandsProcessor);

        return(Task.CompletedTask);
    }
コード例 #3
0
 /// <summary>
 /// Determines whether the specified
 /// <see cref="ChannelFilters"/> is equal to the current
 /// <see cref="ChannelDetail"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="ChannelDetail"/> to compare with the current
 /// <see cref="ChannelDetail"/>.
 /// </param>
 /// <returns>
 /// <c>true</c> if the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>; otherwise,
 /// <c>false</c>.
 /// </returns>
 public bool Equals(ChannelFilters other)
 {
     return(other != null &&
            object.Equals(this.OnlyManaged, other.OnlyManaged) &&
            EnumerableUtils.NullTolerantSequenceEqual(this.CalendarIds, other.CalendarIds));
 }
コード例 #4
0
 /// <summary>
 /// Determines whether the specified
 /// <see cref="ChannelFilters"/> is equal to the current
 /// <see cref="ChannelDetail"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="ChannelDetail"/> to compare with the current
 /// <see cref="ChannelDetail"/>.
 /// </param>
 /// <returns>
 /// <c>true</c> if the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>; otherwise,
 /// <c>false</c>.
 /// </returns>
 public bool Equals(ChannelFilters other)
 {
     return other != null
         && object.Equals(this.OnlyManaged, other.OnlyManaged)
         && EnumerableUtils.NullTolerantSequenceEqual(this.CalendarIds, other.CalendarIds);
 }