示例#1
0
 public static void Bind(DiscordSocketClient client)
 {
     client.AddOnFirstReady(() =>
     {
         Client_Ready(client);
         return(Task.CompletedTask);
     });
 }
示例#2
0
 public static void Bind(DiscordSocketClient client)
 {
     OnMute   += (a, b) => MuteWatcher_OnMute(client, a, b);
     OnUnmute += mute => MuteWatcher_OnUnmute(client, mute);
     client.AddOnFirstReady(() => Client_Ready(client));
     client.UserJoined         += VerifyMute;
     client.GuildMemberUpdated += (oldUser, newUser) => Client_GuildMemberUpdated(client, oldUser, newUser);
 }
示例#3
0
 public static void Bind(DiscordSocketClient client)
 {
     CacheProvider              = new RoleCacheProvider(client);
     client.MessageReceived    += a => Client_MessageReceived(client, a);
     client.GuildMemberUpdated += (a, b) => Client_GuildMemberUpdated(client, a, b);
     client.RoleUpdated        += Client_RoleUpdated;
     client.AddOnFirstReady(() => Client_Ready(client));
     Score.OnUpdate += (a, b) => Score_OnUpdate(client, a, b);
 }
示例#4
0
 /// <summary>
 ///     Attaches event handlers to the client.
 /// </summary>
 public static void Bind(DiscordSocketClient client)
 {
     client.AddOnFirstReady(() =>
     {
         StarboardWatcherConfigurator.GeneralStarboard(client);
         StarboardWatcherConfigurator.StaffVoteStarboard(client);
         StarboardWatcherConfigurator.SuggestionStarboard(client);
         return(Task.CompletedTask);
     });
 }
示例#5
0
        public static async Task <DiscordSocketClient> GetClient()
        {
            var client = new DiscordSocketClient(new DiscordSocketConfig
            {
                MessageCacheSize = 50, AlwaysDownloadUsers = true
            });

            client.Log += Log;
            client.AddOnFirstReady(() => Ready(client));

            await client.LoginAsync(TokenType.Bot, Passwords.DiscordToken);

            await client.StartAsync();

            await client.SetStatusAsync(UserStatus.Online);

            return(client);
        }
示例#6
0
 public static void Bind(DiscordSocketClient client)
 {
     client.AddOnFirstReady(() => Client_Ready(client));
 }