Ejemplo n.º 1
0
        //not tested
        public static void ChangeAvatar(string avatarPath)
        {
            for (int i = 0; i < tokens().Length; i++)
            {
                foreach (var item in tokens())
                {
                    t = new Thread(() =>
                    {
                        try
                        {
                            DiscordClient client   = new DiscordClient();
                            client.Token           = item;
                            UserProfileUpdate prof = new UserProfileUpdate();
                            prof.Avatar            = Image.FromFile(avatarPath);

                            client.User.ChangeProfile(prof);
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.WriteLine("avatar changed for " + client.User.Username);
                        }
                        catch (Exception)
                        {
                        }
                    });
                    t.Start();
                }
            }
            t.Abort();
        }
Ejemplo n.º 2
0
        public TypedMessageResponse <string> Handle(UserProfileUpdate message)
        {
            // Do something
            var summary = message.Name + " " + message.Intro;

            EventAggregator.Instance.Publish(new UserProfileUpdated {
                UserName = message.Name, OccurredAt = DateTime.Now
            });

            return(new TypedMessageResponse <string> {
                Data = "Thank you " + summary
            });
        }