示例#1
0
        private static Task OnGuildMemberUpdated(SocketGuildUser arg1, SocketGuildUser arg2)
        {
            if (arg1.Nickname != arg2.Nickname)
            {
                Core.Log.Write(Core.Log.Type.USER, arg1.GetPath() + " changed nickname to " + arg2.GetShownName());
            }
            if (arg1.GuildPermissions.RawValue != arg2.GuildPermissions.RawValue)
            {
                Core.Log.Write(Core.Log.Type.USER, arg1.GetPath() + " had guild permissions changed.");
            }

            SocketRole added = GetAddedRole(arg1, arg2);

            if (added != null)
            {
                Core.Log.Write(Core.Log.Type.USER, arg1.GetPath() + " had role " + added.GetPath() + " added.");
            }
            else
            {
                SocketRole removed = GetRemovedRole(arg1, arg2);
                if (removed != null)
                {
                    Core.Log.Write(Core.Log.Type.USER, arg1.GetPath() + " had role " + removed.GetPath() + " removed.");
                }
            }

            return(Task.CompletedTask);
        }
示例#2
0
 private static Task OnRoleUpdated(SocketRole arg1, SocketRole arg2)
 {
     if (arg1.Color.RawValue != arg2.Color.RawValue)
     {
         Core.Log.Write(Core.Log.Type.SERVER, "Role " + arg1.GetPath() + " changed colour.");
     }
     if (arg1.Name != arg2.Name)
     {
         Core.Log.Write(Core.Log.Type.SERVER, $"Role {arg1.GetPath()} changed name to {arg2.Name}");
     }
     if (arg1.Permissions.RawValue != arg2.Permissions.RawValue)
     {
         Core.Log.Write(Core.Log.Type.SERVER, "Role " + arg1.GetPath() + " had permissions changed.");
     }
     if (arg1.IsMentionable != arg2.IsMentionable)
     {
         Core.Log.Write(Core.Log.Type.SERVER, "Role " + arg1.GetPath() + " toggled mentionable: " + arg2.IsMentionable);
     }
     return(Task.CompletedTask);
 }
示例#3
0
 private static Task OnRoleCreated(SocketRole arg)
 {
     Core.Log.Write(Core.Log.Type.SERVER, "Role " + arg.GetPath() + " has been created.");
     return(Task.CompletedTask);
 }