示例#1
0
 public DiscordProfile()
 {
     OnClientUpdated += (sender, e) =>
     {
         User.SetClient(Client);
         ConnectedAccounts.SetClientsInList(Client);
     };
 }
示例#2
0
文件: Login.cs 项目: xuan2261/Anarchy
 internal Login()
 {
     OnClientUpdated += (sender, e) =>
     {
         User.SetClient(Client);
         Guilds.SetClientsInList(Client);
         Relationships.SetClientsInList(Client);
         Settings.SetClient(Client);
         PrivateChannels.SetClientsInList(Client);
         ClientGuildSettings.SetClientsInList(Client);
         ConnectedAccounts.SetClientsInList(Client);
         Presences.SetClientsInList(Client);
     };
     JsonUpdated += (sender, json) =>
     {
         Guilds          = json.Value <JArray>("guilds").PopulateListJson <LoginGuild>();
         PrivateChannels = json.Value <JArray>("private_channels").PopulateListJson <PrivateChannel>();
         Presences       = json.Value <JArray>("presences").PopulateListJson <DiscordPresence>();
     };
 }
示例#3
0
        internal LoginEventArgs()
        {
            OnClientUpdated += (sender, e) =>
            {
                User.SetClient(Client);
                Relationships.SetClientsInList(Client);
                Settings.SetClient(Client);
                PrivateChannels.SetClientsInList(Client);
                ClientGuildSettings.SetClientsInList(Client);
                ConnectedAccounts.SetClientsInList(Client);
                Presences.SetClientsInList(Client);

                List <MinimalGuild> guilds = new List <MinimalGuild>();
                foreach (var obj in _guilds)
                {
                    guilds.Add((Client.User.Type == DiscordUserType.User ? obj.ToObject <SocketGuild>() : obj.ToObject <MinimalGuild>()).SetClient(Client));
                }
                Guilds = guilds;
            };
        }