コード例 #1
0
ファイル: Program.cs プロジェクト: Primaski/Collectorcord
 private Task KillSwitchProtocol(SocketGuildUser user)
 {
     if (user.Guild.Id == 597469488778182656)
     {
         if (Killswitch.GetState() == Killswitch.Status.Off)
         {
             if (Server.Util.Poke_Cache != null)
             {
                 Server.Util.Poke_Cache.GetTextChannel(598458534405079041)
                 .SendMessageAsync("<@&598486932699217940>" + user.Username + " has joined, help them out!");
             }
             return(Task.CompletedTask);
         }
         else if (Killswitch.GetState() == Killswitch.Status.Mute)
         {
             user.AddRoleAsync(user.Guild.GetRole(472806594292482088)); //skipped
         }
         else if (Killswitch.GetState() == Killswitch.Status.Kick)
         {
             user.KickAsync();
         }
         else if (Killswitch.GetState() == Killswitch.Status.Ban)
         {
             user.Guild.AddBanAsync(user);
         }
     }
     return(Task.CompletedTask);
 }
コード例 #2
0
ファイル: Admin.cs プロジェクト: Primaski/Collectorcord
        public static string Killswitchactivate(string args)
        {
            if (args == null)
            {
                string u = (Killswitch.GetHelpMenu() + "\n" + "The current state of the Killswitch is: `" + Killswitch.GetState() + "`.");
                return(u);
            }
            args = args.ToLower();
            if (args.Contains("off"))
            {
                Killswitch.SetStatus(Killswitch.Status.Off);
            }
            else if (args.Contains("mute"))
            {
                Killswitch.SetStatus(Killswitch.Status.Mute);
            }
            else if (args.Contains("kick"))
            {
                Killswitch.SetStatus(Killswitch.Status.Kick);
            }
            else if (args.Contains("ban"))
            {
                Killswitch.SetStatus(Killswitch.Status.Ban);
            }
            string w = ("The current state of the Killswitch is: `" + Killswitch.GetState() + "`.");

            return(w);
        }
コード例 #3
0
 private Task UpdateServerCache(SocketGuildUser user)
 {
     if (user.Guild.Id == 597469488778182656)
     {
         GuildCache.Uno_Cache.GetUser(332788739560701955).SendMessageAsync(user.Username + " has joined PokéCollectors~ Help them out! <#598458534405079041>");
         GuildCache.Uno_Cache.GetUser(MY_ID).SendMessageAsync(user.Username + " has joined PokéCollectors~ Help them out! <#598458534405079041>");
         GuildCache.Uno_Cache.GetUser(456335175538835467).SendMessageAsync(user.Username + " has joined PokéCollectors~ Help them out! <#598458534405079041>");
     }
     if (Killswitch.GetState() != Killswitch.Status.Off && user.Guild.Id == UNO_SERVER_ID)
     {
         KillSwitchProtocol(user);
     }
     if (user.Guild.Id == UNO_SERVER_ID)
     {
         GuildCache.InitializeUnoServer(user.Guild);
     }
     SaveFiles_Mapped.CreateUserSaveFolder(user);
     return(Task.CompletedTask);
 }
コード例 #4
0
 private void KillSwitchProtocol(SocketGuildUser user)
 {
     if (Killswitch.GetState() == Killswitch.Status.Off)
     {
         return;
     }
     else if (Killswitch.GetState() == Killswitch.Status.Mute)
     {
         user.AddRoleAsync(user.Guild.GetRole(472806594292482088)); //skipped
     }
     else if (Killswitch.GetState() == Killswitch.Status.Kick)
     {
         user.KickAsync();
     }
     else if (Killswitch.GetState() == Killswitch.Status.Ban)
     {
         user.Guild.AddBanAsync(user);
     }
     return;
 }